Skip to content

Instantly share code, notes, and snippets.

@mikolajprzybysz
Created September 23, 2018 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikolajprzybysz/b9cf6d5e2382366764210bc680933cac to your computer and use it in GitHub Desktop.
Save mikolajprzybysz/b9cf6d5e2382366764210bc680933cac to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
title: Time track API
version: 0.1.0
servers:
- url: http://localhost/v1
description: Local development
paths:
/books/{id}:
get:
operationId: getBook
parameters:
- name: id
in: path
required: true
schema:
type: string
responses:
'200':
description: Returns book resource
content:
application/json:
schema:
$ref: '#/components/schemas/book'
'404':
description: Book resource not found
content:
applicaiton/json:
schema:
$ref: '#/components/schemas/error'
components:
schemas:
book:
required:
- title
- author
properties:
title:
type: string
author:
type: string
error:
required:
- code
- message
properties:
code:
type: integer
format: int32
message:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment