@practica/create-node-app
Version:
Create Node.js app that is packed with best practices AND strive for simplicity
125 lines (124 loc) • 2.99 kB
JSON
{
"openapi": "3.0.3",
"info": {
"title": "Shop",
"description": "This is the API docs of the shop API.",
"termsOfService": "http://swagger.io/terms/",
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "1.0.0"
},
"externalDocs": {
"description": "Find out more about Swagger",
"url": "http://swagger.io"
},
"paths": {
"/order/{orderId}": {
"get": {
"summary": "Find an Order by ID",
"description": "Returns a single order",
"operationId": "getOrderById",
"parameters": [
{
"name": "orderId",
"in": "path",
"description": "ID of order to return",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Order"
}
}
}
},
"400": {
"description": "Invalid ID",
"content": {}
},
"404": {
"description": "Order not found",
"content": {}
}
}
}
},
"/order": {
"post": {
"summary": "Add a new Order",
"description": "Returns a single order",
"operationId": "addOrder",
"requestBody": {
"description": "New Order To Add",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Order"
}
}
}
},
"responses": {
"200": {
"description": "Successful",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Order"
}
}
}
},
"400": {
"description": "User Not Found",
"content": {}
},
"404": {
"description": "User Not Found",
"content": {}
},
"500": {
"description": "Unknown error occured",
"content": {}
}
}
}
}
},
"components": {
"schemas": {
"Order": {
"type": "object",
"required": ["productId", "userId", "mode"],
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"productId": {
"type": "integer",
"format": "int64"
},
"userId": {
"type": "integer",
"format": "int64"
},
"mode": {
"type": "string",
"format": "string"
}
}
}
}
}
}