diff --git a/docsfera.json b/docsfera.json index eaaf00e..ae9f040 100644 --- a/docsfera.json +++ b/docsfera.json @@ -4574,6 +4574,7 @@ "get": { "operationId": "PlatformApiController_getPipelineRunJobs", "summary": "Get pipeline run jobs", + "description": "Proxies platform-api DB-backed job runs and returns `{ jobs: [...] }`.", "parameters": [ { "name": "pipelineId", @@ -4594,11 +4595,22 @@ ], "responses": { "200": { - "description": "", + "description": "DB-backed job runs for the selected pipeline run.", "content": { "application/json": { "schema": { - "type": "object" + "type": "object", + "properties": { + "jobs": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "required": [ + "jobs" + ] } } } diff --git a/src/modules/platform-api/platform-api.controller.ts b/src/modules/platform-api/platform-api.controller.ts index f3abaf5..e8de5ca 100644 --- a/src/modules/platform-api/platform-api.controller.ts +++ b/src/modules/platform-api/platform-api.controller.ts @@ -14,7 +14,7 @@ import { NotFoundException, UseGuards, } from '@nestjs/common'; -import { ApiTags, ApiOperation } from '@nestjs/swagger'; +import { ApiTags, ApiOperation, ApiOkResponse } from '@nestjs/swagger'; import { DadosferaLogger } from '@dadosfera/dadosfera-logs'; import { @@ -72,6 +72,10 @@ export class PlatformApiController { return id?.replace(/-/g, '_') || ''; } + private decodePathParam(value: string): string { + return value ? decodeURIComponent(value) : ''; + } + /** * Denormalize ID back to UUID format (replace _ with -). * Used when we receive a normalized ID but need the original UUID. @@ -833,7 +837,23 @@ export class PlatformApiController { } @Get('pipelines/:pipelineId/pipeline_run/:runId/jobs') - @ApiOperation({ summary: 'Get pipeline run jobs' }) + @ApiOperation({ + summary: 'Get pipeline run jobs', + description: 'Proxies platform-api DB-backed job runs and returns `{ jobs: [...] }`.', + }) + @ApiOkResponse({ + description: 'DB-backed job runs for the selected pipeline run.', + schema: { + type: 'object', + properties: { + jobs: { + type: 'array', + items: { type: 'object' }, + }, + }, + required: ['jobs'], + }, + }) @RequireAllPermissions(PERMISSIONS_GROUPS.PIPELINE.permissions.GET) async getPipelineRunJobs( @Param('pipelineId') pipelineId: string, @@ -841,11 +861,11 @@ export class PlatformApiController { @User() user: RequestUser, ) { const normalizedPipelineId = this.normalizePipelineId(pipelineId); - const normalizedRunId = this.normalizePipelineId(runId); + const decodedRunId = this.decodePathParam(runId); return this.platformApiService.proxy( 'GET', - `/pipeline/${normalizedPipelineId}/pipeline_run/${normalizedRunId}/jobs`, + `/pipeline/${normalizedPipelineId}/pipeline_run/${decodedRunId}/jobs`, user, ); }