{ "swagger": "2.0", "info": { "title": "Test API", "description": "Description for Test API using Apicurio Studio", "contact": { "name": "Laurent Broudoux", "url": "http://www.github.com/lbroudoux", "email": "laurent.broudoux@gmail.com" }, "license": { "name": "GNU GPLv3", "url": "https://www.gnu.org/licenses/gpl.txt" }, "version": "0.0.1" }, "paths": { "/order": { "get": { "summary": "Retrieve a list of orders", "description": "Retrieve a list of orders", "parameters": [ { "name": "status", "in": "query", "type": "string" }, { "name": "page", "in": "query", "type": "integer" } ], "responses": { "200": { "description": "List of orders was found", "schema": { "type": "array", "items": { "type": "#/definitions/Order" } } } } }, "post": { "summary": "Create (place) a new order", "description": "Create (place) a new order", "parameters": [ { "name": "body", "in": "body", "description": "The order to create", "schema": { "$ref": "#/definitions/Order" } } ], "responses": { "201": { "description": "Order was correctly created", "schema": { "$ref": "#/definitions/Order" } } } } }, "/order/{id}": { "get": { "summary": "Retrieve and existing order using its id", "description": "Retrieve an existing order using its id", "responses": { "200": { "description": "Order was found and is in response", "schema": { "$ref": "#/definitions/Order" } } } }, "delete": { "summary": "Delete an existing order using its id", "description": "Delete an existing order using its id", "responses": { "204": { "description": "Order was correctly removed" } } }, "parameters": [ { "name": "id", "in": "path", "description": "Unique identifier of order to retrieve or remove", "required": true, "type": "string" } ] } }, "tags": [ { "name": "order", "description": "Manipulate orders (CRUD)" } ], "definitions": { "Item": { "properties": { "id": { "type": "string" }, "label": { "type": "string" }, "price": { "type": "number" } } }, "LineItem": { "properties": { "price": { "type": "number" }, "quantity": { "type": "integer" }, "item": { "$ref": "#/definitions/Item" } } }, "Order": { "properties": { "id": { "type": "string" }, "amount": { "type": "number" }, "devise": { "type": "string" }, "items": { "type": "array", "items": { "type": "#/definitions/LineItem" } }, "status": { "type": "string" } } } } }