Skip to content

api: routes that throw ConflictException do not document 409 in the OpenAPI spec #5028

@mu-hashmi

Description

@mu-hashmi

Describe the bug

The API throws ConflictException from at least seven call sites, but the routes above them mostly document only their success and 400 responses. Spot-checked example: POST /snapshots annotates 200 and 400 (snapshot.controller.ts) while createFromPull throws a 409 for duplicate names (snapshot.service.ts). The OpenAPI spec has no 409 entry for that route, so the generated SDKs say nothing about it either. SDK users discover the conflict behavior by hitting it.

Throw sites to audit:

  • snapshot.service.ts: createFromPull and the build path (two sites)
  • sandbox.service.ts: three duplicate-name sites on the create paths
  • region.service.ts: duplicate region name
  • runner.service.ts: duplicate domain

To Reproduce

Build the spec (npx nx run api:openapi) and compare the responses object for POST /snapshots against the ConflictException in createFromPull. The 409 is absent.

Expected behavior

Every route that can return 409 declares it with @apiresponse, and the clients are regenerated once after the audit. #5002 annotated its new endpoint and #4999 annotated the capture route; this issue covers the routes that predate them.

Additional context

This is one small PR: add the missing annotations, run yarn generate:api-client once, commit the additive changes. For scale: documenting a single 409 measured 12 insertions and 0 deletions across four generated client files, so the full audit should stay compact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions