Skip to content

Instantly share code, notes, and snippets.

@JeanBarriere
Created August 30, 2019 12:25
Show Gist options
  • Save JeanBarriere/8c7cebda852d9da8acf9abe741765e73 to your computer and use it in GitHub Desktop.
Save JeanBarriere/8c7cebda852d9da8acf9abe741765e73 to your computer and use it in GitHub Desktop.
open api yaml tests
{"components":{"schemas":{"Pets":{"type":"array","items":{"$ref":"#/components/schemas/Pet"}},"Error":{"type":"object","required":["code","message"],"properties":{"code":{"format":"int32","type":"integer"},"message":{"type":"string"}}},"Pet":{"type":"object","required":["id","name"],"properties":{"name":{"type":"string"},"id":{"format":"int64","type":"integer"},"tag":{"type":"string"}}}}},"servers":[{"url":"http://petstore.swagger.io/v1"}],"openapi":"3.0.0","paths":{"/pets":{"post":{"summary":"Create a pet","operationId":"createPets","responses":{"|default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"201":{"description":"Null response"}},"tags":["pets"]},"get":{"summary":"List all pets","operationId":"listPets","responses":{"200":{"headers":{"x-next":{"schema":{"type":"string"},"description":"A link to the next page of responses"}},"description":"A paged array of pets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pets"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"schema":{"format":"int32","type":"integer"},"in":"query","name":"limit","description":"How many items to return at one time (max 100)","required":false}],"tags":["pets"]}},"/pets/{petId}":{"get":{"summary":"Info for a specific pet","operationId":"showPetById","responses":{"200":{"description":"Expected response to a valid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pet"}}}},"default":{"description":"unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"petId","description":"The id of the pet to retrieve","required":true}],"tags":["pets"]}}},"info":{"license":{"name":"MIT"},"title":"Swagger Petstore","version":"1.0.0"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment