-
-
Save lbrenman/6e0fbd724cb6b351198467eaf1595195 to your computer and use it in GitHub Desktop.
OAS3 Stock Watchlist API Definition (Stoplight export)
This file contains 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": "watchlist", | |
"version": "1.0", | |
"contact": { | |
"name": "Leor Brenman" | |
}, | |
"description": "Stock Watch List API" | |
}, | |
"servers": [ | |
{ | |
"url": "http://localhost:3000" | |
} | |
], | |
"paths": { | |
"/watchlist": { | |
"get": { | |
"summary": "Your GET endpoint", | |
"tags": [ | |
"Watch List" | |
], | |
"responses": { | |
"200": { | |
"description": "OK", | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "array", | |
"items": { | |
"$ref": "#/components/schemas/Quote" | |
} | |
}, | |
"examples": { | |
"example-1": { | |
"value": [ | |
{ | |
"symbol": "TXN", | |
"lastPrice": 174.74, | |
"change": 2.4199982 | |
}, | |
{ | |
"symbol": "AAPL", | |
"lastPrice": 157.58, | |
"change": 2.4900055 | |
} | |
] | |
} | |
} | |
} | |
} | |
}, | |
"400": { | |
"description": "Bad Request", | |
"content": { | |
"application/json": { | |
"schema": { | |
"type": "string" | |
}, | |
"examples": { | |
"example-1": { | |
"value": "Error" | |
} | |
} | |
} | |
} | |
} | |
}, | |
"operationId": "get-watchlist", | |
"description": "Stock Watch List API", | |
"parameters": [ | |
{ | |
"schema": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"in": "query", | |
"explode": false, | |
"name": "stocklist", | |
"description": "Comma separated list of stock symbols (e.g. aapl,txn,amzn)", | |
"required": true, | |
"style": "form" | |
} | |
] | |
} | |
} | |
}, | |
"components": { | |
"schemas": { | |
"Quote": { | |
"title": "quote", | |
"type": "object", | |
"x-tags": [ | |
"stock quote" | |
], | |
"properties": { | |
"symbol": { | |
"type": "string" | |
}, | |
"lastPrice": { | |
"type": "number" | |
}, | |
"change": { | |
"type": "number" | |
} | |
} | |
} | |
}, | |
"securitySchemes": {} | |
}, | |
"tags": [ | |
{ | |
"name": "Watch List" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment