Browse Source

v0.9

master
Nicolas Massé 5 years ago
parent
commit
5559f75f35
  1. 109
      openapi.json

109
openapi.json

@ -2,8 +2,16 @@
"openapi": "3.0.2", "openapi": "3.0.2",
"info": { "info": {
"title": "Library API", "title": "Library API",
"version": "1.0.0", "version": "0.9.0",
"description": "A simple API for managing authors and books" "description": "A simple API for managing authors and books.",
"contact": {
"name": "Eric Wittmann",
"email": "eric.wittmann@redhat.com"
},
"license": {
"name": "Mozilla 2.0",
"url": "https://www.mozilla.org/en-US/MPL/2.0/"
}
}, },
"paths": { "paths": {
"/authors": { "/authors": {
@ -21,12 +29,17 @@
} }
}, },
"examples": { "examples": {
"all_authors": { "authors": {
"value": [ "value": [
{ {
"id": "vhugo", "id": "mpagnol",
"name": "Victor Hugo", "name": "Marcel Pagnol",
"dob": "26-02-1885" "dob": "1895-02-28"
},
{
"id": "ezola",
"name": "Émile Zola",
"dob": "1840-04-02"
} }
] ]
} }
@ -66,21 +79,7 @@
"summary": "Path used to manage a single Author.", "summary": "Path used to manage a single Author.",
"description": "The REST endpoint/path used to get, update, and delete single instances of an `Author`. This path contains `GET`, `PUT`, and `DELETE` operations used to perform the get, update, and delete tasks, respectively.", "description": "The REST endpoint/path used to get, update, and delete single instances of an `Author`. This path contains `GET`, `PUT`, and `DELETE` operations used to perform the get, update, and delete tasks, respectively.",
"get": { "get": {
"parameters": [ "tags": [
{
"examples": {
"vhugo": {
"value": "vhugo"
}
},
"name": "authorId",
"description": "A unique identifier for a `Author`.",
"schema": {
"type": "string"
},
"in": "path",
"required": true
}
], ],
"responses": { "responses": {
"200": { "200": {
@ -88,19 +87,13 @@
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/Author" "$ref": "#/components/schemas/Author"
},
"examples": {
"vhugo": {
"value": {
"id": "vhugo",
"name": "Victor Hugo",
"dob": "26-02-1885"
}
}
} }
} }
}, },
"description": "Successful response - returns a single `Author`." "description": "Successful response - returns a single `Author`."
},
"404": {
"$ref": "#/components/responses/NotFound"
} }
}, },
"operationId": "getAuthor", "operationId": "getAuthor",
@ -122,6 +115,9 @@
"responses": { "responses": {
"202": { "202": {
"description": "Successful response." "description": "Successful response."
},
"404": {
"$ref": "#/components/responses/NotFound"
} }
}, },
"operationId": "updateAuthor", "operationId": "updateAuthor",
@ -132,6 +128,9 @@
"responses": { "responses": {
"204": { "204": {
"description": "Successful response." "description": "Successful response."
},
"404": {
"$ref": "#/components/responses/NotFound"
} }
}, },
"operationId": "deleteAuthor", "operationId": "deleteAuthor",
@ -263,7 +262,7 @@
"schemas": { "schemas": {
"Author": { "Author": {
"title": "Root Type for Author", "title": "Root Type for Author",
"description": "", "description": "The author of a book.",
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
@ -273,53 +272,53 @@
"type": "string" "type": "string"
}, },
"dob": { "dob": {
"format": "date",
"type": "string" "type": "string"
} }
}, },
"example": { "example": {
"id": "vhugo", "id": "jk-rowling",
"name": "Victor Hugo", "name": "JK Rowling",
"dob": "26-02-1885" "dob": "1968-01-01"
} }
}, },
"Book": { "Book": {
"title": "Root Type for Book", "title": "Root Type for Book",
"description": "", "description": "Information about a book.",
"type": "object", "type": "object",
"properties": { "properties": {
"title": { "ddsn": {
"type": "string"
},
"publish-date": {
"type": "string" "type": "string"
}, },
"ddsn": { "title": {
"description": "",
"type": "string" "type": "string"
}, },
"author": { "author": {
"$ref": "#/components/schemas/Author", "$ref": "#/components/schemas/Author"
"description": "" },
"publish-date": {
"format": "date",
"type": "string"
} }
}, },
"example": { "example": {
"title": "Les Misérables", "ddsn": "632.4",
"publish-date": "01-01-1862" "title": "SQL For Dummies",
"publish-date": "2001-05-13"
} }
} }
}, },
"securitySchemes": { "responses": {
"api-key": { "NotFound": {
"type": "apiKey", "content": {
"name": "api-key", "application/json": {
"in": "header" "schema": {
"type": "string"
} }
} }
}, },
"security": [ "description": "Generic response when not found."
{ }
"api-key": [ }
]
} }
]
} }
Loading…
Cancel
Save