Skip to content

Instantly share code, notes, and snippets.

@shockey
Created April 23, 2018 20:25
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 shockey/852d839ad3540c797b027281e1fe565e to your computer and use it in GitHub Desktop.
Save shockey/852d839ad3540c797b027281e1fe565e to your computer and use it in GitHub Desktop.
openapi: 3.0.0
servers:
- url: /api
info:
title: basejs API
version: 0.0.1
description: Documentation of the RESTful API exposed by basejs
security:
- JWT: []
paths:
'/products/{id}':
parameters:
- $ref: '#/components/parameters/idParam'
get:
tags:
- Products
description: Get a product by id
responses:
'200':
description: Product
content:
application/json:
schema:
$ref: '#/components/schemas/Product'
default:
$ref: '#/components/responses/ErrorResponse'
tags: []
components:
responses:
ErrorResponse:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
parameters:
idParam:
name: id
in: path
description: id of item
required: true
schema:
type: string
securitySchemes:
JWT:
type: http
scheme: bearer
bearerFormat: Bearer
schemas:
Product:
type: object
required:
- title
properties:
_id:
type: string
readOnly: true
title:
type: string
price:
type: number
ownerId:
type: string
createdAt:
type: string
format: date-time
readOnly: true
updatedAt:
type: string
format: date-time
readOnly: true
Error:
type: object
required:
- statusCode
properties:
statusCode:
type: integer
error:
type: string
message:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment