Last active
November 2, 2020 23:40
-
-
Save hotmeteor/ed4b8ec25cee2f0535cd577d82670346 to your computer and use it in GitHub Desktop.
Spectator example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"openapi": "3.0.0", | |
"info": { | |
"title": "Users.v1", | |
"version": "1.0" | |
}, | |
"servers": [ | |
{ | |
"url": "http://localhost:3000" | |
} | |
], | |
"paths": { | |
"/users": { | |
"get": { | |
"summary": "Get users", | |
"tags": [], | |
"responses": { | |
"200": { | |
"description": "OK", | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "number", | |
"description": "User ID", | |
"example": 1 | |
}, | |
"name": { | |
"type": "string", | |
"description": "User name", | |
"example": "Adam Campbell" | |
}, | |
"email": { | |
"type": "string", | |
"description": "User email address", | |
"format": "email", | |
"example": "[email protected]" | |
} | |
} | |
} | |
}, | |
"examples": { | |
"example-1": { | |
"value": [ | |
{ | |
"id": 1, | |
"name": "Adam Campbell", | |
"email": "[email protected]" | |
} | |
] | |
} | |
} | |
} | |
} | |
} | |
}, | |
"operationId": "get-users", | |
"parameters": [ | |
{ | |
"schema": { | |
"type": "string", | |
"enum": [ | |
"name", | |
"email" | |
] | |
}, | |
"in": "query", | |
"name": "order", | |
"allowEmptyValue": true | |
} | |
] | |
}, | |
"post": { | |
"summary": "Create user", | |
"tags": [], | |
"responses": { | |
"201": { | |
"description": "Created" | |
} | |
}, | |
"operationId": "post-users", | |
"requestBody": { | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "object", | |
"properties": { | |
"name": { | |
"type": "string", | |
"example": "Adam Campbell" | |
}, | |
"email": { | |
"type": "string", | |
"format": "email", | |
"example": "[email protected]" | |
} | |
}, | |
"required": [ | |
"name", | |
"email" | |
] | |
} | |
} | |
} | |
} | |
} | |
} | |
}, | |
"components": { | |
"schemas": {} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment