From 19b59df0afb16dccf0a321e5fd02f337952aef70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Jacobo=20Vi=C3=B1a=20Rebolledo?= Date: Mon, 11 Dec 2023 22:30:06 +0100 Subject: [PATCH] [GH-119] fix OAS3 spec and newman routine --- doc/postman/collections/ts-api.json | 424 ++++++++-------------------- src/apps/apiApp/openApi.yaml | 359 +++++------------------ 2 files changed, 189 insertions(+), 594 deletions(-) diff --git a/doc/postman/collections/ts-api.json b/doc/postman/collections/ts-api.json index 481e3ec..d4cb890 100644 --- a/doc/postman/collections/ts-api.json +++ b/doc/postman/collections/ts-api.json @@ -1,10 +1,10 @@ { "info": { - "_postman_id": "e727e61d-6878-4434-9795-4cd04299d844", + "_postman_id": "78550744-b9a0-4303-a812-92980f2f5c30", "name": "ts-api", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "30268071", - "_collection_link": "https://vinjatovix.postman.co/workspace/vinjatovix-Workspace~59364019-9d51-4f17-8557-f17e428fa64b/collection/30268071-e727e61d-6878-4434-9795-4cd04299d844?action=share&source=collection_link&creator=30268071" + "_collection_link": "https://vinjatovix.postman.co/workspace/vinjatovix-Workspace~59364019-9d51-4f17-8557-f17e428fa64b/collection/30268071-78550744-b9a0-4303-a812-92980f2f5c30?action=share&source=collection_link&creator=30268071" }, "item": [ { @@ -87,13 +87,19 @@ }, "response": [ { - "name": "400", + "name": "400 - Bad Request", "originalRequest": { - "method": "PUT", - "header": [], + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], "body": { "mode": "raw", - "raw": "{\n \"title\": \"{{$randomWords}}\",\n \"author\": \"{{$randomLoremParagraph}}\",\n \"isbn\": \"978-3-16-148410-0\",\n \"releaseDate\": \"{{$isoTimestamp}}\",\n \"pages\": {{$randomInt}}\n}", + "raw": "{\n\n}", "options": { "raw": { "language": "json" @@ -101,7 +107,7 @@ } }, "url": { - "raw": "{{host}}/api/v1/Books/:id", + "raw": "{{host}}/api/v1/Books/", "host": [ "{{host}}" ], @@ -109,14 +115,7 @@ "api", "v1", "Books", - ":id" - ], - "variable": [ - { - "key": "id", - "value": "{{$guid}}", - "description": "required" - } + "" ] } }, @@ -125,23 +124,23 @@ "_postman_previewlanguage": "json", "header": [ { - "key": "vary", + "key": "Vary", "value": "Origin" }, { - "key": "access-control-allow-credentials", + "key": "Access-Control-Allow-Credentials", "value": "true" }, { - "key": "x-xss-protection", + "key": "X-XSS-Protection", "value": "0" }, { - "key": "x-content-type-options", + "key": "X-Content-Type-Options", "value": "nosniff" }, { - "key": "x-frame-options", + "key": "X-Frame-Options", "value": "DENY" }, { @@ -149,29 +148,33 @@ "value": "application/json; charset=utf-8" }, { - "key": "content-length", - "value": "214" + "key": "Content-Length", + "value": "327" }, { - "key": "date", - "value": "Sun, 15 Oct 2023 19:24:03 GMT" + "key": "ETag", + "value": "W/\"147-Uqx9YQqS9vxQrY/921w8mP4rYLA\"" }, { - "key": "connection", + "key": "Date", + "value": "Mon, 11 Dec 2023 20:11:50 GMT" + }, + { + "key": "Connection", "value": "keep-alive" }, { - "key": "keep-alive", + "key": "Keep-Alive", "value": "timeout=5" } ], "cookie": [], - "body": "{\n \"message\": \" has more than 40 characters\"\n}" + "body": "{\n \"errors\": [\n {\n \"id\": \"Invalid value at body. Value: undefined\"\n },\n {\n \"title\": \"Invalid value at body. Value: undefined\"\n },\n {\n \"author\": \"Invalid value at body. Value: undefined\"\n },\n {\n \"isbn\": \"Invalid value at body. Value: undefined\"\n },\n {\n \"releaseDate\": \"Invalid value at body. Value: undefined\"\n },\n {\n \"pages\": \"Invalid value at body. Value: undefined\"\n }\n ]\n}" }, { - "name": "201 Create Book", + "name": "201", "originalRequest": { - "method": "PUT", + "method": "POST", "header": [ { "key": "Content-Type", @@ -189,7 +192,7 @@ } }, "url": { - "raw": "{{host}}/api/v1/Books/:id", + "raw": "{{host}}/api/v1/Books/", "host": [ "{{host}}" ], @@ -197,14 +200,7 @@ "api", "v1", "Books", - ":id" - ], - "variable": [ - { - "key": "id", - "value": "{{bookId}}", - "description": "required" - } + "" ] } }, @@ -213,136 +209,44 @@ "_postman_previewlanguage": "plain", "header": [ { - "key": "vary", + "key": "Vary", "value": "Origin" }, { - "key": "access-control-allow-credentials", + "key": "Access-Control-Allow-Credentials", "value": "true" }, { - "key": "x-xss-protection", + "key": "X-XSS-Protection", "value": "0" }, { - "key": "x-content-type-options", + "key": "X-Content-Type-Options", "value": "nosniff" }, { - "key": "x-frame-options", + "key": "X-Frame-Options", "value": "DENY" }, { - "key": "date", - "value": "Sun, 22 Oct 2023 21:22:08 GMT" - }, - { - "key": "content-length", - "value": "0" - }, - { - "key": "x-envoy-upstream-service-time", - "value": "76" - }, - { - "key": "server", - "value": "envoy" - } - ], - "cookie": [], - "body": null - }, - { - "name": "422 Create Book", - "originalRequest": { - "method": "PUT", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"title\": \"Cambridgeshire 1080p withdrawal Fresh Applications\",\n \"isbn\": \"562\",\n \"releaseDate\": \"Shoes\",\n \"pages\": \"Ergonomic\"\n}", - "options": { - "raw": { - "language": "json" - } - } + "key": "Date", + "value": "Mon, 11 Dec 2023 20:12:32 GMT" }, - "url": { - "raw": "{{host}}/api/v1/Books/:id", - "host": [ - "{{host}}" - ], - "path": [ - "api", - "v1", - "Books", - ":id" - ], - "variable": [ - { - "key": "id", - "value": "{{bookId}}", - "description": "required" - } - ] - } - }, - "status": "Unprocessable Entity", - "code": 422, - "_postman_previewlanguage": "json", - "header": [ { - "key": "vary", - "value": "Origin" + "key": "Connection", + "value": "keep-alive" }, { - "key": "access-control-allow-credentials", - "value": "true" + "key": "Keep-Alive", + "value": "timeout=5" }, { - "key": "x-xss-protection", + "key": "Content-Length", "value": "0" - }, - { - "key": "x-content-type-options", - "value": "nosniff" - }, - { - "key": "x-frame-options", - "value": "DENY" - }, - { - "key": "content-type", - "value": "application/json; charset=utf-8" - }, - { - "key": "content-length", - "value": "265" - }, - { - "key": "etag", - "value": "W/\"109-ZTX09fa4Re8D4j59ZWnDD9eMBmE\"" - }, - { - "key": "date", - "value": "Sun, 22 Oct 2023 21:22:41 GMT" - }, - { - "key": "x-envoy-upstream-service-time", - "value": "3" - }, - { - "key": "server", - "value": "envoy" } ], "cookie": [], - "body": "{\n \"errors\": [\n {\n \"id\": \"Invalid value at body. Value: undefined\"\n },\n {\n \"author\": \"Invalid value at body. Value: undefined\"\n },\n {\n \"isbn\": \"Invalid value at body. Value: 562\"\n },\n {\n \"releaseDate\": \"Invalid value at body. Value: Shoes\"\n },\n {\n \"pages\": \"Invalid value at body. Value: Ergonomic\"\n }\n ]\n}" + "body": null } ] }, @@ -388,7 +292,7 @@ } ], "request": { - "method": "PUT", + "method": "PATCH", "header": [ { "key": "Content-Type", @@ -398,7 +302,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"id\": \"{{bookId}}\",\n \"title\": \"{{$randomWords}}\",\n \"author\": \"{{$randomNamePrefix}} {{$randomLastName}}\",\n \"isbn\": \"978-3-16-148410-0\",\n \"releaseDate\": \"{{$isoTimestamp}}\",\n \"pages\": {{$randomInt}}\n}", + "raw": "{\n \"pages\": {{$randomInt}}\n}", "options": { "raw": { "language": "json" @@ -427,13 +331,19 @@ }, "response": [ { - "name": "422", + "name": "200 Update Book", "originalRequest": { "method": "PUT", - "header": [], + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], "body": { "mode": "raw", - "raw": "{\n \"title\": \"multi-tasking Concrete Shoes Andorra\",\n \"isbn\": \"8\",\n \"releaseDate\": \"content\",\n \"pages\": \"Monitored\"\n}", + "raw": "{\n \"id\": \"{{bookId}}\",\n \"title\": \"{{$randomWords}}\",\n \"author\": \"{{$randomNamePrefix}} {{$randomLastName}}\",\n \"isbn\": \"978-3-16-148410-0\",\n \"releaseDate\": \"{{$isoTimestamp}}\",\n \"pages\": {{$randomInt}}\n}", "options": { "raw": { "language": "json" @@ -441,12 +351,10 @@ } }, "url": { - "raw": "http://localhost:3000/api/v1/Books/:id", - "protocol": "http", + "raw": "{{host}}/api/v1/Books/:id", "host": [ - "localhost" + "{{host}}" ], - "port": "3000", "path": [ "api", "v1", @@ -456,15 +364,15 @@ "variable": [ { "key": "id", - "value": "JSON", + "value": "{{bookId}}", "description": "required" } ] } }, - "status": "Unprocessable Entity", - "code": 422, - "_postman_previewlanguage": "json", + "status": "OK", + "code": 200, + "_postman_previewlanguage": "plain", "header": [ { "key": "vary", @@ -487,41 +395,39 @@ "value": "DENY" }, { - "key": "Content-Type", - "value": "application/json; charset=utf-8" + "key": "date", + "value": "Sun, 22 Oct 2023 21:21:43 GMT" }, { "key": "content-length", - "value": "263" - }, - { - "key": "etag", - "value": "W/\"107-1SWyRDyHUwHOAtJsyzyflhpva1k\"" - }, - { - "key": "date", - "value": "Sun, 15 Oct 2023 19:23:47 GMT" + "value": "0" }, { - "key": "connection", - "value": "keep-alive" + "key": "x-envoy-upstream-service-time", + "value": "77" }, { - "key": "keep-alive", - "value": "timeout=5" + "key": "server", + "value": "envoy" } ], "cookie": [], - "body": "{\n \"errors\": [\n {\n \"id\": \"Invalid value at params. Value: USB\"\n },\n {\n \"author\": \"Invalid value at body. Value: undefined\"\n },\n {\n \"isbn\": \"Invalid value at body. Value: 522\"\n },\n {\n \"releaseDate\": \"Invalid value at body. Value: leading-edge\"\n },\n {\n \"pages\": \"Invalid value at body. Value: Baht\"\n }\n ]\n}" + "body": null }, { "name": "400", "originalRequest": { - "method": "PUT", - "header": [], + "method": "PATCH", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + } + ], "body": { "mode": "raw", - "raw": "{\n \"title\": \"implementation indexing olive user-facing Dam\",\n \"author\": \"Rerum maiores est harum. Qui explicabo provident dicta eligendi aliquid. Beatae quisquam distinctio dolor eos minima autem quia iure consequatur. Dolores fuga placeat sequi perspiciatis excepturi porro quia dolorem. Sed ratione facilis aut deserunt ut eos. Mollitia illum laborum cumque sed laudantium earum dolores.\",\n \"isbn\": \"978-3-16-148410-0\",\n \"releaseDate\": \"2023-10-18T19:02:16.082Z\",\n \"pages\": 480\n}", + "raw": "{\n\n}", "options": { "raw": { "language": "json" @@ -529,12 +435,10 @@ } }, "url": { - "raw": "http://localhost:3000/api/v1/Books/:id", - "protocol": "http", + "raw": "{{host}}/api/v1/Books/:id", "host": [ - "localhost" + "{{host}}" ], - "port": "3000", "path": [ "api", "v1", @@ -544,7 +448,7 @@ "variable": [ { "key": "id", - "value": "6c54a304-2e54-4970-a687-bd99e414c099", + "value": "{{bookId}}", "description": "required" } ] @@ -555,23 +459,23 @@ "_postman_previewlanguage": "json", "header": [ { - "key": "vary", + "key": "Vary", "value": "Origin" }, { - "key": "access-control-allow-credentials", + "key": "Access-Control-Allow-Credentials", "value": "true" }, { - "key": "x-xss-protection", + "key": "X-XSS-Protection", "value": "0" }, { - "key": "x-content-type-options", + "key": "X-Content-Type-Options", "value": "nosniff" }, { - "key": "x-frame-options", + "key": "X-Frame-Options", "value": "DENY" }, { @@ -579,113 +483,28 @@ "value": "application/json; charset=utf-8" }, { - "key": "content-length", - "value": "214" + "key": "Content-Length", + "value": "52" }, { - "key": "etag", - "value": "W/\"d6-UvcKv5g+ijEEpnLp3cngfhEGt+o\"" + "key": "ETag", + "value": "W/\"34-WYPaNNTEMe2TFB9Qv3t6oFEAc8E\"" }, { - "key": "date", - "value": "Sun, 15 Oct 2023 19:24:03 GMT" + "key": "Date", + "value": "Mon, 11 Dec 2023 20:13:41 GMT" }, { - "key": "connection", + "key": "Connection", "value": "keep-alive" }, { - "key": "keep-alive", + "key": "Keep-Alive", "value": "timeout=5" } ], "cookie": [], - "body": "{\n \"message\": \" has more than 40 characters\"\n}" - }, - { - "name": "200 Update Book", - "originalRequest": { - "method": "PUT", - "header": [ - { - "key": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"id\": \"{{bookId}}\",\n \"title\": \"{{$randomWords}}\",\n \"author\": \"{{$randomNamePrefix}} {{$randomLastName}}\",\n \"isbn\": \"978-3-16-148410-0\",\n \"releaseDate\": \"{{$isoTimestamp}}\",\n \"pages\": {{$randomInt}}\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "{{host}}/api/v1/Books/:id/update", - "host": [ - "{{host}}" - ], - "path": [ - "api", - "v1", - "Books", - ":id", - "update" - ], - "variable": [ - { - "key": "id", - "value": "{{bookId}}", - "description": "required" - } - ] - } - }, - "status": "OK", - "code": 200, - "_postman_previewlanguage": "plain", - "header": [ - { - "key": "vary", - "value": "Origin" - }, - { - "key": "access-control-allow-credentials", - "value": "true" - }, - { - "key": "x-xss-protection", - "value": "0" - }, - { - "key": "x-content-type-options", - "value": "nosniff" - }, - { - "key": "x-frame-options", - "value": "DENY" - }, - { - "key": "date", - "value": "Sun, 22 Oct 2023 21:21:43 GMT" - }, - { - "key": "content-length", - "value": "0" - }, - { - "key": "x-envoy-upstream-service-time", - "value": "77" - }, - { - "key": "server", - "value": "envoy" - } - ], - "cookie": [], - "body": null + "body": "{\n \"errors\": [\n {\n \"message\": \"Empty body is not allowed\"\n }\n ]\n}" } ] }, @@ -734,12 +553,10 @@ "method": "GET", "header": [], "url": { - "raw": "http://localhost:3000/api/v1/Books/:id", - "protocol": "http", + "raw": "{{host}}/api/v1/Books/:id", "host": [ - "localhost" + "{{host}}" ], - "port": "3000", "path": [ "api", "v1", @@ -749,8 +566,7 @@ "variable": [ { "key": "id", - "value": "", - "description": "required" + "value": "" } ] } @@ -857,12 +673,10 @@ "method": "DELETE", "header": [], "url": { - "raw": "http://localhost:3000/api/v1/Books/:id", - "protocol": "http", + "raw": "{{host}}/api/v1/Books/:id", "host": [ - "localhost" + "{{host}}" ], - "port": "3000", "path": [ "api", "v1", @@ -1066,12 +880,10 @@ "method": "GET", "header": [], "url": { - "raw": "http://localhost:3000/api/v1/health/http", - "protocol": "http", + "raw": "{{host}}/api/v1/health/http", "host": [ - "localhost" + "{{host}}" ], - "port": "3000", "path": [ "api", "v1", @@ -1085,23 +897,23 @@ "_postman_previewlanguage": "json", "header": [ { - "key": "vary", + "key": "Vary", "value": "Origin" }, { - "key": "access-control-allow-credentials", + "key": "Access-Control-Allow-Credentials", "value": "true" }, { - "key": "x-xss-protection", + "key": "X-XSS-Protection", "value": "0" }, { - "key": "x-content-type-options", + "key": "X-Content-Type-Options", "value": "nosniff" }, { - "key": "x-frame-options", + "key": "X-Frame-Options", "value": "DENY" }, { @@ -1109,28 +921,28 @@ "value": "application/json; charset=utf-8" }, { - "key": "content-length", + "key": "Content-Length", "value": "33" }, { - "key": "etag", - "value": "W/\"21-Rei14saXbyNBzYa963Az8GGsDLs\"" + "key": "ETag", + "value": "W/\"21-9x4XyE9hg/2X1jGi8LTMUW8FKYc\"" }, { - "key": "date", - "value": "Sun, 15 Oct 2023 18:04:29 GMT" + "key": "Date", + "value": "Mon, 11 Dec 2023 21:26:05 GMT" }, { - "key": "connection", + "key": "Connection", "value": "keep-alive" }, { - "key": "keep-alive", + "key": "Keep-Alive", "value": "timeout=5" } ], "cookie": [], - "body": "{\n \"version\": \"1.2.2\",\n \"status\": \"OK\"\n}" + "body": "{\n \"version\": \"1.4.0\",\n \"status\": \"OK\"\n}" } ] } diff --git a/src/apps/apiApp/openApi.yaml b/src/apps/apiApp/openApi.yaml index 4460490..4c956c0 100644 --- a/src/apps/apiApp/openApi.yaml +++ b/src/apps/apiApp/openApi.yaml @@ -1,4 +1,5 @@ openapi: 3.0.3 + info: title: ts-api description: |- @@ -13,9 +14,15 @@ info: name: MIT License url: https://github.com/vinjatovix/ts-api/blob/develop/LICENSE.md version: '1.4.0' + servers: - url: HOST variables: {} + +tags: + - name: Books + - name: Health + paths: /api/v1/Books: get: @@ -32,8 +39,8 @@ paths: type: array items: $ref: '#/components/schemas/Book' - post: + deprecated: false tags: - Books summary: Create Book @@ -73,7 +80,6 @@ paths: $ref: '#/components/headers/x-envoy-upstream-service-time' server: $ref: '#/components/headers/server' - content: {} '400': description: Bad Request @@ -101,38 +107,16 @@ paths: schema: $ref: '#/components/schemas/400' example: - message: has more than 40 characters - '422': - description: Unprocessable Entity - headers: - vary: - $ref: '#/components/headers/vary' - access-control-allow-credentials: - $ref: '#/components/headers/access-control-allow-credentials' - x-xss-protection: - $ref: '#/components/headers/x-xss-protection' - x-content-type-options: - $ref: '#/components/headers/x-content-type-options' - x-frame-options: - $ref: '#/components/headers/x-frame-options' - date: - $ref: '#/components/headers/date' - connection: - $ref: '#/components/headers/connection' - keep-alive: - $ref: '#/components/headers/keep-alive' - content-length: - $ref: '#/components/headers/content-length' - etag: - $ref: '#/components/headers/etag' + errors: + - id: 'Invalid value at params. Value: USB' + - author: 'Invalid value at body. Value: undefined' + - isbn: 'Invalid value at body. Value: 522' + - releaseDate: 'Invalid value at body. Value: leading-edge' + - pages: 'Invalid value at body. Value: Baht' - content: - application/json: - schema: - $ref: '#/components/schemas/422' - deprecated: false /api/v1/Books/{id}: get: + deprecated: false tags: - Books summary: Get Book by Id @@ -174,8 +158,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Book' + patch: deprecated: false - put: tags: - Books summary: Update Book by Id @@ -194,65 +178,28 @@ paths: content: application/json: example: - id: '{{$guid}}' - title: '{{$randomWords}}' - author: '{{$randomNamePrefix}} {{$randomLastName}}' - isbn: '978-3-16-148410-0' - releaseDate: '{{$isoTimestamp}}' pages: 1500 required: true responses: '200': - description: Created + description: Updated headers: vary: - content: - text/plain: - schema: - type: string - example: Origin + $ref: '#/components/headers/vary' access-control-allow-credentials: - content: - text/plain: - schema: - type: string - example: 'true' + $ref: '#/components/headers/access-control-allow-credentials' x-xss-protection: - content: - text/plain: - schema: - type: string - example: '0' + $ref: '#/components/headers/x-xss-protection' x-content-type-options: - content: - text/plain: - schema: - type: string - example: nosniff + $ref: '#/components/headers/x-content-type-options' x-frame-options: - content: - text/plain: - schema: - type: string - example: DENY + $ref: '#/components/headers/x-frame-options' date: - content: - text/plain: - schema: - type: string - example: Sun, 15 Oct 2023 19:19:00 GMT + $ref: '#/components/headers/date' connection: - content: - text/plain: - schema: - type: string - example: keep-alive + $ref: '#/components/headers/connection' keep-alive: - content: - text/plain: - schema: - type: string - example: timeout=5 + $ref: '#/components/headers/keep-alive' content-length: content: text/plain: @@ -264,140 +211,30 @@ paths: description: Bad Request headers: vary: - content: - text/plain: - schema: - type: string - example: Origin + $ref: '#/components/headers/vary' access-control-allow-credentials: - content: - text/plain: - schema: - type: string - example: 'true' + $ref: '#/components/headers/access-control-allow-credentials' x-xss-protection: - content: - text/plain: - schema: - type: string - example: '0' + $ref: '#/components/headers/x-xss-protection' x-content-type-options: - content: - text/plain: - schema: - type: string - example: nosniff + $ref: '#/components/headers/x-content-type-options' x-frame-options: - content: - text/plain: - schema: - type: string - example: DENY - content-length: - content: - text/plain: - schema: - type: string - example: '214' - etag: - content: - text/plain: - schema: - type: string - example: W/"d6-UvcKv5g+ijEEpnLp3cngfhEGt+o" + $ref: '#/components/headers/x-frame-options' date: - content: - text/plain: - schema: - type: string - example: Sun, 15 Oct 2023 19:24:03 GMT + $ref: '#/components/headers/date' connection: - content: - text/plain: - schema: - type: string - example: keep-alive + $ref: '#/components/headers/connection' keep-alive: - content: - text/plain: - schema: - type: string - example: timeout=5 + $ref: '#/components/headers/keep-alive' content: application/json: schema: $ref: '#/components/schemas/400' example: - message: has more than 40 characters - '422': - description: Unprocessable Entity - headers: - vary: - content: - text/plain: - schema: - type: string - example: Origin - access-control-allow-credentials: - content: - text/plain: - schema: - type: string - example: 'true' - x-xss-protection: - content: - text/plain: - schema: - type: string - example: '0' - x-content-type-options: - content: - text/plain: - schema: - type: string - example: nosniff - x-frame-options: - content: - text/plain: - schema: - type: string - example: DENY - content-length: - content: - text/plain: - schema: - type: string - example: '263' - etag: - content: - text/plain: - schema: - type: string - example: W/"107-1SWyRDyHUwHOAtJsyzyflhpva1k" - date: - content: - text/plain: - schema: - type: string - example: Sun, 15 Oct 2023 19:23:47 GMT - connection: - content: - text/plain: - schema: - type: string - example: keep-alive - keep-alive: - content: - text/plain: - schema: - type: string - example: timeout=5 - content: - application/json: - schema: - $ref: '#/components/schemas/422' - deprecated: false + errors: + - message: 'Empty body is not allowed' delete: + deprecated: false tags: - Books summary: Delete Book by Id @@ -432,9 +269,10 @@ paths: keep-alive: $ref: '#/components/headers/keep-alive' content: {} - deprecated: false + /api/v1/health/http: get: + deprecated: false tags: - Health summary: Api server @@ -445,73 +283,30 @@ paths: description: OK headers: vary: - content: - text/plain: - schema: - type: string - example: Origin + $ref: '#/components/headers/vary' access-control-allow-credentials: - content: - text/plain: - schema: - type: string - example: 'true' + $ref: '#/components/headers/access-control-allow-credentials' x-xss-protection: - content: - text/plain: - schema: - type: string - example: '0' + $ref: '#/components/headers/x-xss-protection' x-content-type-options: - content: - text/plain: - schema: - type: string - example: nosniff + $ref: '#/components/headers/x-content-type-options' x-frame-options: - content: - text/plain: - schema: - type: string - example: DENY + $ref: '#/components/headers/x-frame-options' content-length: - content: - text/plain: - schema: - type: string - example: '33' + $ref: '#/components/headers/content-length' etag: - content: - text/plain: - schema: - type: string - example: W/"21-Rei14saXbyNBzYa963Az8GGsDLs" + $ref: '#/components/headers/etag' date: - content: - text/plain: - schema: - type: string - example: Sun, 15 Oct 2023 18:04:29 GMT + $ref: '#/components/headers/date' connection: - content: - text/plain: - schema: - type: string - example: keep-alive + $ref: '#/components/headers/connection' keep-alive: - content: - text/plain: - schema: - type: string - example: timeout=5 + $ref: '#/components/headers/keep-alive' content: application/json: schema: $ref: '#/components/schemas/Health' - example: - version: 1.2.2 - status: OK - deprecated: false + components: headers: connection: @@ -528,37 +323,37 @@ components: description: The vary header schema: type: string - example: Origin + example: Origin access-control-allow-credentials: description: The access-control-allow-credentials header schema: type: string - example: 'true' + example: 'true' x-xss-protection: description: The x-xss-protection header schema: type: string - example: '0' + example: '0' x-content-type-options: description: The x-content-type-options header schema: type: string - example: nosniff + example: nosniff x-frame-options: description: The x-frame-options header schema: type: string - example: DENY + example: DENY date: description: The Date header schema: type: string - example: Sun, 15 Oct 2023 19:19:00 GMT + example: Sun, 15 Oct 2023 19:19:00 GMT content-length: description: The content-length header schema: type: string - example: '0' + example: '0' x-envoy-upstream-service-time: description: The X-Envoy-Upstream-Service-Time header schema: @@ -571,41 +366,32 @@ components: description: The ETag header schema: type: string + schemas: - Error: - title: Error - type: object - properties: - message: - type: string - example: - id: 'Invalid value at params. Value: USB' - 422: - title: validation error - required: - - errors + 400: + title: '400' type: object properties: errors: type: array items: - $ref: '#/components/schemas/Error' - description: '' + type: object + properties: + author: + type: string + isbn: + type: string + releaseDate: + type: string + pages: + type: string example: errors: - - id: 'Invalid value at params. Value: USB' - author: 'Invalid value at body. Value: undefined' - isbn: 'Invalid value at body. Value: 522' - releaseDate: 'Invalid value at body. Value: leading-edge' - pages: 'Invalid value at body. Value: Baht' - 400: - title: '400' - type: object - properties: - message: - type: string - example: - message: has more than 40 characters + Health: title: OK type: object @@ -615,7 +401,7 @@ components: status: type: string example: - version: 1.2.2 + version: 1.4.0 status: OK Book: type: object @@ -639,6 +425,3 @@ components: isbn: '978-3-16-148410-0' releaseDate: '2023-10-15T22:00:21.845Z' pages: 576 -tags: - - name: Books - - name: Health