From cfa4a4965209b7651d1ba733756592c56219e520 Mon Sep 17 00:00:00 2001 From: Nicolas MASSE Date: Wed, 27 Jan 2021 15:25:04 +0100 Subject: [PATCH] v1.1 --- openapi.json | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/openapi.json b/openapi.json index 26d3c2e..fd424b6 100644 --- a/openapi.json +++ b/openapi.json @@ -2,7 +2,7 @@ "openapi": "3.0.2", "info": { "title": "Library API", - "version": "1.0.0", + "version": "1.1.0", "description": "A simple API for managing authors and books.", "contact": { "name": "Eric Wittmann", @@ -256,6 +256,39 @@ "required": true } ] + }, + "/books/{bookId}/buy": { + "summary": "Buy a book", + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BookOrder" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "OK" + } + }, + "operationId": "BuyBook", + "summary": "BuyBook" + }, + "parameters": [ + { + "name": "bookId", + "description": "id of a book", + "schema": { + "type": "integer" + }, + "in": "path", + "required": true + } + ] } }, "components": { @@ -306,6 +339,20 @@ "title": "SQL For Dummies", "publish-date": "2001-05-13" } + }, + "BookOrder": { + "title": "Root Type for BookOrder", + "description": "", + "type": "object", + "properties": { + "number": { + "format": "int32", + "type": "integer" + } + }, + "example": { + "number": 1 + } } }, "responses": {