diff --git a/api/generate/openapi.json b/api/generate/openapi.json index c68d6b45..4b4f653c 100644 --- a/api/generate/openapi.json +++ b/api/generate/openapi.json @@ -148,9 +148,9 @@ } } }, - "/api/v1/comments/": { + "/api/v1/comments": { "get": { - "operationId": "CommentV1ApiSpec_get_/", + "operationId": "CommentV1ApiSpec_get_/comments", "tags": [ "Comment" ], @@ -244,7 +244,7 @@ } }, "post": { - "operationId": "CommentV1ApiSpec_post_/", + "operationId": "CommentV1ApiSpec_post_/comments", "tags": [ "Comment" ], @@ -304,7 +304,7 @@ }, "/api/v1/comments/{commentId}": { "delete": { - "operationId": "CommentV1ApiSpec_delete_/{commentId}", + "operationId": "CommentV1ApiSpec_delete_/comments/{commentId}", "tags": [ "Comment" ], @@ -348,7 +348,7 @@ } }, "put": { - "operationId": "CommentV1ApiSpec_put_/{commentId}", + "operationId": "CommentV1ApiSpec_put_/comments/{commentId}", "tags": [ "Comment" ], @@ -415,160 +415,6 @@ } } }, - "/api/v1/comments/test": { - "get": { - "operationId": "CommentV1ApiSpec_get_/test", - "tags": [ - "Comment" - ], - "summary": "List comments", - "security": [ - { - "jwt": [] - } - ], - "parameters": [ - { - "name": "nickname", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "allowReserved": true - }, - { - "name": "movieName", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "allowReserved": true - }, - { - "name": "sortBy", - "in": "query", - "required": false, - "schema": { - "enum": [ - "createdAt", - "movieName" - ], - "type": "string" - } - }, - { - "name": "direction", - "in": "query", - "required": false, - "schema": { - "enum": [ - "asc", - "desc" - ], - "type": "string" - } - }, - { - "name": "pageOffset", - "in": "query", - "required": false, - "schema": { - "type": "number" - } - }, - { - "name": "pageSize", - "in": "query", - "required": false, - "schema": { - "type": "number" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ListCommentsV1Response" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorResponse" - } - } - } - } - } - }, - "post": { - "operationId": "CommentV1ApiSpec_post_/test", - "tags": [ - "Comment" - ], - "summary": "Create comment", - "security": [ - { - "jwt": [] - } - ], - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "movieName": { - "type": "string" - }, - "content": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "content", - "movieName" - ] - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateCommentV1Response" - } - } - } - }, - "default": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HttpErrorResponse" - } - } - } - } - } - } - }, "/api/v1/dev/greeting": { "post": { "operationId": "DevV1ApiSpec_post_/greeting", diff --git a/api/src/controller/http/comment/schema/comment.v1.schema.ts b/api/src/controller/http/comment/schema/comment.v1.schema.ts index 4884fe71..f2fa636d 100644 --- a/api/src/controller/http/comment/schema/comment.v1.schema.ts +++ b/api/src/controller/http/comment/schema/comment.v1.schema.ts @@ -15,10 +15,10 @@ import { HttpErrorResponse } from '@controller/http/response'; export type CommentV1ApiSpec = Tspec.DefineApiSpec<{ security: 'jwt'; - basePath: '/api/v1/comments'; + basePath: '/api/v1'; tags: ['Comment']; paths: { - '/': { + '/comments': { post: { summary: 'Create comment'; body: CreateCommentV1Request; @@ -36,7 +36,7 @@ export type CommentV1ApiSpec = Tspec.DefineApiSpec<{ }; }; }; - '/{commentId}': { + '/comments/{commentId}': { put: { summary: 'Update comment'; path: { commentId: number }; @@ -55,23 +55,5 @@ export type CommentV1ApiSpec = Tspec.DefineApiSpec<{ }; }; }; - '/test': { - post: { - summary: 'Create comment'; - body: CreateCommentV1Request; - responses: { - 200: CreateCommentV1Response; - default: HttpErrorResponse; - }; - }; - get: { - summary: 'List comments'; - query: ListCommentsV1QueryParameter; - responses: { - 200: ListCommentsV1Response; - default: HttpErrorResponse; - }; - }; - }; }; }>;