Skip to content

POST /jobs OpenAPI spec doesn't match runtime behavior #154

@luandro

Description

@luandro

Description

The OpenAPI specification documents POST /jobs differently than the runtime implementation.

OpenAPI Spec (api-server/openapi.ts)

  • Status code: 201
  • Response schema: { success: boolean, job: any }
registry.registerPath({
  method: "post",
  path: "/jobs",
  responses: {
    201: {
      description: "Job created successfully",
      content: {
        "application/json": {
          schema: jobResponseSchema, // { success, job }
        },
      },
    },
  },
});

Runtime Implementation (api-server/routes/jobs.ts:352-359)

  • Status code: 202
  • Response schema: { jobId: string, status: "pending" }
return plainJsonResponse(
  {
    jobId,
    status: "pending",
  },
  202,
  requestOrigin
);

Impact

  • Generated API clients will expect wrong response format
  • Type mismatches for consumers relying on OpenAPI spec
  • Documentation doesn't reflect actual API behavior

Recommendation

Update the OpenAPI spec to match runtime behavior (202 Accepted with {jobId, status} schema).

Priority

Low - Documentation inconsistency, doesn't break existing clients

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions