Skip to content

Instantly share code, notes, and snippets.

@MervinPraison
Created July 13, 2020 19:07
Show Gist options
  • Save MervinPraison/457cde2704cfc9b072442417ca3d7508 to your computer and use it in GitHub Desktop.
Save MervinPraison/457cde2704cfc9b072442417ca3d7508 to your computer and use it in GitHub Desktop.
Openapi
{"openapi":"3.0.2","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/":{"get":{"summary":"Read Root","operationId":"read_root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/items/{item_id}":{"get":{"summary":"Read Item","operationId":"read_item_items__item_id__get","parameters":[{"required":true,"schema":{"title":"Item Id","type":"integer"},"name":"item_id","in":"path"},{"required":false,"schema":{"title":"Q","type":"string"},"name":"q","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Item","operationId":"update_item_items__item_id__put","parameters":[{"required":true,"schema":{"title":"Item Id","type":"integer"},"name":"item_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Item"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"Item":{"title":"Item","required":["name","price"],"type":"object","properties":{"name":{"title":"Name","type":"string"},"price":{"title":"Price","type":"number"},"is_offer":{"title":"Is Offer","type":"boolean"}}},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"type":"string"}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment