Browse Source

v1.1

master
Nicolas Massé 5 years ago
parent
commit
cfa4a49652
  1. 49
      openapi.json

49
openapi.json

@ -2,7 +2,7 @@
"openapi": "3.0.2", "openapi": "3.0.2",
"info": { "info": {
"title": "Library API", "title": "Library API",
"version": "1.0.0", "version": "1.1.0",
"description": "A simple API for managing authors and books.", "description": "A simple API for managing authors and books.",
"contact": { "contact": {
"name": "Eric Wittmann", "name": "Eric Wittmann",
@ -256,6 +256,39 @@
"required": true "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": { "components": {
@ -306,6 +339,20 @@
"title": "SQL For Dummies", "title": "SQL For Dummies",
"publish-date": "2001-05-13" "publish-date": "2001-05-13"
} }
},
"BookOrder": {
"title": "Root Type for BookOrder",
"description": "",
"type": "object",
"properties": {
"number": {
"format": "int32",
"type": "integer"
}
},
"example": {
"number": 1
}
} }
}, },
"responses": { "responses": {

Loading…
Cancel
Save