Skip to content

Instantly share code, notes, and snippets.

@matt-allan
Created September 12, 2017 05:44
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 matt-allan/cb86b42adeca511e7191f0c2f9d7b7ec to your computer and use it in GitHub Desktop.
Save matt-allan/cb86b42adeca511e7191f0c2f9d7b7ec to your computer and use it in GitHub Desktop.
openapi: 3.0.0
info:
version: 1.0.0
title: Matt's Bicycle Shop API
servers:
- url: http://api.matts-bikes.dev/v1
paths:
/work-orders:
post:
summary: Create a work order
requestBody:
description: Work order to create
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/NewWorkOrder'
responses:
201:
description: The Created Work Order
content:
application/json:
schema:
$ref: "#/components/schemas/WorkOrder"
default:
description: unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
schemas:
WorkOrder:
allOf:
- $ref: '#/components/schemas/NewWorkOrder'
- required:
- id
properties:
id:
type: integer
NewWorkOrder:
type: object
required:
- data
properties:
data:
type: object
required:
- bicycle
- repairs
- due_date
properties:
bicycle:
type: string
repairs:
type: array
items:
type: string
due_date:
type: string
format: date-time
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
message:
type: string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment