diff --git a/packages/api/src/app.controller.ts b/packages/api/src/app.controller.ts index 34196752e..69791d337 100644 --- a/packages/api/src/app.controller.ts +++ b/packages/api/src/app.controller.ts @@ -1,6 +1,6 @@ import { LoggerService } from '@@core/@core-services/logger/logger.service'; import { Controller, Get } from '@nestjs/common'; -import { ApiOperation, ApiResponse } from '@nestjs/swagger'; +import { ApiOkResponse, ApiOperation, ApiResponse } from '@nestjs/swagger'; import { AppService } from './app.service'; import { ApiGetCustomResponse } from '@@core/utils/dtos/openapi.respone.dto'; @@ -14,14 +14,22 @@ export class AppController { } @ApiOperation({ operationId: 'hello' }) - @ApiGetCustomResponse(String) + @ApiOkResponse({ + schema: { + type: 'string', + }, + }) @Get() hello(): string { return this.appService.getHello(); } @ApiOperation({ operationId: 'health' }) - @ApiGetCustomResponse(Number) + @ApiOkResponse({ + schema: { + type: 'number', + }, + }) @Get('health') health(): number { return 200; diff --git a/packages/api/src/main.ts b/packages/api/src/main.ts index 0280cb482..fd869d5a7 100644 --- a/packages/api/src/main.ts +++ b/packages/api/src/main.ts @@ -14,8 +14,8 @@ function addSpeakeasyGroup(document: any) { const pathParts = path.split('/').filter((part) => part); let groupName; - if (pathParts[0] === 'webhook') { - groupName = 'webhook'; + if (pathParts[0] === 'webhooks') { + groupName = 'webhooks'; } else if (pathParts[0] === 'sync') { groupName = 'sync'; } else if (pathParts[0] === 'linked-users') { diff --git a/packages/api/swagger/swagger-spec.yaml b/packages/api/swagger/swagger-spec.yaml index 3f786eb48..ec67d3a5c 100644 --- a/packages/api/swagger/swagger-spec.yaml +++ b/packages/api/swagger/swagger-spec.yaml @@ -11,7 +11,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/String' + type: string /health: get: operationId: health @@ -23,7 +23,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Number' + type: number /webhooks: get: operationId: listWebhooks @@ -40,6 +40,7 @@ paths: $ref: '#/components/schemas/WebhookResponse' tags: &ref_0 - webhooks + x-speakeasy-group: webhooks post: operationId: createWebhookPublic summary: Add webhook metadata @@ -58,6 +59,7 @@ paths: schema: $ref: '#/components/schemas/WebhookResponse' tags: *ref_0 + x-speakeasy-group: webhooks /webhooks/{id}: delete: operationId: delete @@ -78,7 +80,7 @@ paths: schema: $ref: '#/components/schemas/WebhookResponse' tags: *ref_0 - x-speakeasy-group: webhooks.{id} + x-speakeasy-group: webhooks put: operationId: updateStatus summary: Update webhook status @@ -98,7 +100,7 @@ paths: schema: $ref: '#/components/schemas/WebhookResponse' tags: *ref_0 - x-speakeasy-group: webhooks.{id} + x-speakeasy-group: webhooks /webhooks/verifyEvent: post: operationId: verifyEvent @@ -124,7 +126,7 @@ paths: '201': description: '' tags: *ref_0 - x-speakeasy-group: webhooks.verifyevent + x-speakeasy-group: webhooks /ticketing/tickets: get: operationId: listTicketingTicket @@ -7790,12 +7792,6 @@ components: type: http scheme: bearer schemas: - String: - type: object - properties: {} - Number: - type: object - properties: {} WebhookResponse: type: object properties: