{ "name": "state-example", "description": "Sample API to play with Apibuilder", "base_url": "https://mkows.github.io", "info": { "contact": { "name": "Michal Kowaliszyn", "url": "https://github.com/mkows" }, "license": { "name": "MIT", "url": "http://opensource.org/licenses/MIT" } }, "enums": { "item_state_progress": { "values": [ {"name": "Init"}, {"name": "Pending"}, {"name": "Completed"} ] }, "item_state_failed_cause": { "values": [ {"name": "ErrorCause1"}, {"name": "ErrorCause2"}, {"name": "ErrorCause3"} ] } }, "models": { "healthcheck": { "fields": [ { "name": "status", "type": "string", "example": "healthy" } ] }, "error": { "fields": [ { "name": "code", "type": "integer" }, { "name": "message", "type": "string" }, { "name": "details", "type": "string", "required": false } ] } }, "unions": { "item_state": { "discriminator": "type", "types": [ { "type": "item_state_progress" }, { "type": "item_state_failed_cause" } ] } }, "resources": { "healthcheck": { "path": "/_internal_/healthcheck", "operations": [ { "method": "GET", "responses": { "200": { "type": "healthcheck" } } }, { "method": "POST", "path": "/test_form_params_json", "parameters": [ { "name": "param1", "location": "form", "type": "string" } ], "responses": { "204": { "type": "unit" } } }, { "method": "GET", "path": "/:id", "parameters": [ { "name": "id", "location": "path", "type": "integer" } ], "responses": { "200": { "type": "healthcheck" }, "400": { "type": "error" }, "401": { "type": "unit" }, "403": { "type": "string" }, "404": { "type": "unit" } } } ] } } }