Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
paths:
/swagger:
get:
summary: Return swagger API specification
description: |
Returns the My Cars API spec as a json swagger doc.
tags:
- Meta
responses:
'200':
description: The My Cars API spec as a json swagger doc.
schema:
type: string
'500':
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/postman:
get:
summary: Return postman collection for API endpoints
description: |
Returns a postman collection for endpoint testing in json format.
tags:
- Meta
responses:
'200':
description: The postman collection as a json object.
schema:
type: string
'500':
description: Unexpected error
schema:
$ref: '#/definitions/Error'
/cars:
get:
summary: List all (dream) cars
description: |
Returns a list of all currently owned (in my dreams) cars.
tags:
- Cars
responses:
'200':
description: An array of Car objects
schema:
$ref: '#/definitions/Cars'
'500':
description: Unexpected error
schema:
$ref: '#/definitions/Error'
post:
summary: Add a new (dream) car
description: |
Adds a new car to the database.
tags:
- Cars
parameters:
- name: car
schema:
$ref: '#/definitions/Car'
in: body
required: true
description: the new dream car
responses:
'200':
description: Succeeded
'500':
description: unexpected error
schema:
$ref: '#/definitions/Error'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment