-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathhussars.json
1 lines (1 loc) · 4.8 KB
/
hussars.json
1
{"info":{"title":"Horses and Hussars 1","description":"Demo app for dev of grape swagger 2.0","version":"v1"},"swagger":"2.0","produces":["application/json"],"host":"lefnord-hussars.ngrok.io","basePath":"/api","paths":{"/hussars":{"get":{"produces":["application/json"],"responses":{"200":{"description":"Get something","schema":{"$ref":"#/definitions/Base"}}}},"post":{"produces":["application/json"],"responses":{"201":{"description":"Hussar created","schema":{"$ref":"#/definitions/Hussar"}},"422":{"description":"Validation Errors","schema":{"$ref":"#/definitions/ApiError"}}},"parameters":[{"in":"formData","name":"name","description":"Name of Hussar to create","type":"string","required":true,"allowMultiple":false},{"in":"formData","name":"born","description":"Birthday of Hussar to create","type":"string","required":true,"allowMultiple":false,"format":"date"}]}},"/hussars/{id}":{"get":{"produces":["application/json"],"responses":{"200":{"description":"get Hussar(s)","schema":{"$ref":"#/definitions/Hussar"}}},"parameters":[{"in":"path","name":"id","description":"Identifier of Hussar","type":"integer","required":true,"allowMultiple":false,"format":"int32","defaultValue":"1"}]},"put":{"produces":["application/json"],"responses":{"200":{"description":"updated Hussar","schema":{"$ref":"#/definitions/Hussar"}},"422":{"description":"Validation Errors","schema":{"$ref":"#/definitions/ApiError"}}},"parameters":[{"in":"path","name":"id","description":"Identity of Hussar","type":"integer","required":true,"allowMultiple":false,"format":"int32","defaultValue":1},{"in":"formData","name":"name","description":"Name of Hussar","type":"string","required":false,"allowMultiple":false,"defaultValue":"Jon"},{"in":"formData","name":"born","description":"Birthday of Hussar","type":"string","required":false,"allowMultiple":false,"format":"date","defaultValue":"07-07-1972"}]},"delete":{"produces":["application/json"],"responses":{"200":{"description":"deleted Hussar","schema":{"$ref":"#/definitions/Hussar"}}},"parameters":[{"in":"path","name":"id","description":"Identity of Hussar to delete","type":"integer","required":true,"allowMultiple":false,"format":"int32","defaultValue":"1"}]}},"/horses":{"get":{"produces":["application/json"],"responses":{"200":{"description":"get Horses","schema":{"$ref":"#/definitions/Horse"}},"422":{"description":"HorsesOutError","schema":{"$ref":"#/definitions/ApiError"}}}},"post":{"produces":["application/json"],"responses":{"201":{"description":"Horse created","schema":{"$ref":"#/definitions/Horse"}},"422":{"description":"Validation Errors","schema":{"$ref":"#/definitions/ApiError"}}},"parameters":[{"in":"formData","name":"name","description":"Name of Horse to create","type":"string","required":true,"allowMultiple":false},{"in":"formData","name":"hussar_id","description":"Associated Hussar to create","type":"integer","required":false,"allowMultiple":false,"format":"int32"}]}},"/horses/{id}":{"get":{"produces":["application/json"],"responses":{"200":{"description":"get Horse(s)","schema":{"$ref":"#/definitions/Horse"}}},"parameters":[{"in":"path","name":"id","description":"Identifier of Horse.","type":"integer","required":true,"allowMultiple":false,"format":"int32","defaultValue":"1"}]},"put":{"produces":["application/json"],"responses":{"200":{"description":"updated Horse","schema":{"$ref":"#/definitions/Horse"}},"422":{"description":"Validation Errors","schema":{"$ref":"#/definitions/ApiError"}}},"parameters":[{"in":"path","name":"id","description":"Identity of Horse","type":"integer","required":true,"allowMultiple":false,"format":"int32","defaultValue":1},{"in":"formData","name":"name","description":"Name of Horse","type":"string","required":false,"allowMultiple":false,"defaultValue":"Jon"},{"in":"formData","name":"hussar_id","description":"Associated Hussar of Horse","type":"integer","required":false,"allowMultiple":false,"format":"int32","defaultValue":"1"}]},"delete":{"produces":["application/json"],"responses":{"200":{"description":"deleted Horse","schema":{"$ref":"#/definitions/Horse"}}},"parameters":[{"in":"path","name":"id","description":"Identity of Horse to delete","type":"integer","required":true,"allowMultiple":false,"format":"int32","defaultValue":"1"}]}}},"definitions":{"Base":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"href":{"type":"string"}}},"Hussar":{"properties":{"id":{"type":"integer"},"name":{"type":"string"},"href":{"type":"string"},"born":{"type":"string"},"size":{"type":"integer"},"age":{"type":"integer"},"gender":{"type":"integer"},"horses":{"type":"Array"}}},"ApiError":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}},"Horse":{"properties":{"id":{"type":"integer"},"name":{"type":"string"},"href":{"type":"string"},"size":{"type":"integer"},"age":{"type":"integer"},"gender":{"type":"integer"},"hussar":{"type":"integer"}}}}}