diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 27baa1694ac..fb34d39f75a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -222,6 +222,25 @@ jobs: targets: test:e2e projects: ${{matrix.projectName}} + - name: Start Api + env: + IN_MEMORY_CLUSTER_MODE_ENABLED: true + run: cd apps/api && pnpm start:test & + + - name: Wait on Api + run: wait-on --timeout=180000 http://localhost:1336/v1/health-check + + - name: Get swagger json as file + run: | + curl -o swagger.json http://localhost:1336/api-json + + - uses: char0n/swagger-editor-validate@v1 + with: + definition-file: swagger.json + + - name: Kill port for api 1336 for unit tests + run: sudo kill -9 $(sudo lsof -t -i:1336) + test_unit: name: Unit Test runs-on: ubuntu-latest diff --git a/apps/api/src/app/events/dtos/trigger-event-request.dto.ts b/apps/api/src/app/events/dtos/trigger-event-request.dto.ts index 55c50fe9811..1ee27c7a8db 100644 --- a/apps/api/src/app/events/dtos/trigger-event-request.dto.ts +++ b/apps/api/src/app/events/dtos/trigger-event-request.dto.ts @@ -13,14 +13,6 @@ export class TopicPayloadDto { type: TriggerRecipientsTypeEnum; } -export class BulkTriggerEventDto { - @ApiProperty() - @IsArray() - @ArrayNotEmpty() - @ArrayMaxSize(100) - events: TriggerEventRequestDto[]; -} - @ApiExtraModels(SubscriberPayloadDto) @ApiExtraModels(TopicPayloadDto) export class TriggerEventRequestDto { @@ -77,6 +69,7 @@ export class TriggerEventRequestDto { $ref: getSchemaPath(TopicPayloadDto), }, ], + type: [String, SubscriberPayloadDto, TopicPayloadDto], isArray: true, }) @IsDefined() @@ -101,3 +94,14 @@ export class TriggerEventRequestDto { @IsOptional() actor?: TriggerRecipientSubscriber; } + +export class BulkTriggerEventDto { + @ApiProperty({ + isArray: true, + type: TriggerEventRequestDto, + }) + @IsArray() + @ArrayNotEmpty() + @ArrayMaxSize(100) + events: TriggerEventRequestDto[]; +} diff --git a/apps/api/src/app/shared/dtos/pagination-response.ts b/apps/api/src/app/shared/dtos/pagination-response.ts index dc3d3bb9b76..4926f06794c 100644 --- a/apps/api/src/app/shared/dtos/pagination-response.ts +++ b/apps/api/src/app/shared/dtos/pagination-response.ts @@ -20,6 +20,7 @@ export class PaginatedResponseDto implements IPaginatedResponseDto { @ApiProperty({ description: 'The list of items matching the query', isArray: true, + type: Object, }) data: T[]; }