{ "swagger": "2.0", "info": { "title": "Todo App API", "description": "Example Todo Application API", "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0.0" }, "basePath": "/api", "schemes": [ "http", "https" ], "paths": { "/": { "get": { "tags": [ "tasks", "fetching" ], "summary": "List all tasks", "description": "Fetches all tasks from the database", "operationId": "ff6234ed-a159-4d44-ad14-22e0a3cd7c7a", "produces": [ "application/json" ], "responses": { "200": { "description": "All is good", "schema": { "type": "array", "items": { "$ref": "#/definitions/Task" } } }, "500": { "description": "Server Error" } } }, "post": { "tags": [ "tasks", "creating" ], "summary": "Create new task", "description": "Stores new task in the database", "operationId": "753cd3a5-8854-4eef-8594-c01e5afd36e0", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "body", "in": "body", "description": "Task to create", "required": true, "schema": { "$ref": "#/definitions/Task" } } ], "responses": { "201": { "description": "All is good", "schema": { "$ref": "#/definitions/Task" } }, "500": { "description": "Server Error" } } } }, "/{id}": { "get": { "tags": [ "tasks", "fetching" ], "summary": "Fetch task", "description": "Fetches task by given identifier", "operationId": "7dfe8c6b-4636-489d-9990-57d6d5ce61d9", "produces": [ "application/json" ], "parameters": [ { "name": "id", "in": "path", "description": "Task identifier", "required": true, "type": "integer", "format": "int64" } ], "responses": { "200": { "description": "All is good", "schema": { "$ref": "#/definitions/Task" } }, "404": { "description": "No task with provided identifier found" }, "500": { "description": "Server Error" } } }, "put": { "tags": [ "tasks", "updating" ], "summary": "Update task", "description": "Updates task by given identifier", "operationId": "c7099be6-e496-4442-b310-dbfd54baa308", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "id", "in": "path", "description": "Task identifier", "required": true, "type": "integer", "format": "int64" }, { "name": "body", "in": "body", "description": "Task with updates", "required": true, "schema": { "$ref": "#/definitions/Task" } } ], "responses": { "200": { "description": "All is good", "schema": { "$ref": "#/definitions/Task" } }, "404": { "description": "No Record with this ID" }, "500": { "description": "Server Error" } } }, "delete": { "tags": [ "tasks", "destruction" ], "summary": "Delete task", "description": "Deletes task by given identifier", "operationId": "204baf17-7d45-450e-b811-7a44695d570f", "parameters": [ { "name": "id", "in": "path", "description": "Task identifier to delete", "required": true, "type": "integer", "format": "int64" } ], "responses": { "204": { "description": "Task deleted" }, "404": { "description": "No Record found with this ID" }, "500": { "description": "Server Error" } } } } }, "definitions": { "Task": { "type": "object", "properties": { "id": { "format": "int64", "title": "Task ID", "description": "Unique task identifier", "type": "integer" }, "task": { "title": "The task", "description": "Task line", "type": "string" }, "completed": { "title": "Task completition status", "description": "0 - ongoing, 1 - completed", "maximum": 1, "minimum": 0, "type": "integer" } } } }, "securityDefinitions": { "username_password": { "type": "basic" } } }