feat(custom-domain): document the organization custom domain listing

Merged
FA
19d ago
+220-0

🎯 Why

q-core serves GET /organization/{organizationId}/customDomain in production (QOV-2543), but openapi.yaml does not describe it. As a result, none of the generated clients (Go, TypeScript, Rust) expose it, and the console, CLI and Terraform provider cannot call it.

🛠️ What

Documents the endpoint as q-core serves it today. It is restricted to organization admins. The optional projectId, environmentId and search filters narrow the list, and page / pageSize paginate it. Each result is one domain name of one environment, with every route that serves it. The generated client method is listOrganizationCustomDomain in a new OrganizationCustomDomainApi.

🟢 Risk: low (additive: one new path, 7 new schemas and 1 new enum; existing shapes are unchanged) · 💥 Breaking: no · ↩️ Rollback: plain revert

🗺️ Review guide · check the spec matches what q-core returns
  1. openapi.yaml: check the path '/organization/{organizationId}/customDomain' against q-core's OrganizationCustomDomainController. page and pageSize are integer (q-core returns 400 on non-integers), pageSize is limited to 1..100 with a default of 20, and the only possible 403 is for a caller who is not an organization admin.
  2. Same file, OrganizationCustomDomainPaginatedResponseList and OrganizationCustomDomainResponse: check them against q-core's OrganizationCustomDomainDto.kt. Every property is required. port and path_rewrite are nullable, and q-core writes them as null rather than omitting them. Results have no id: environment_id and domain together identify one.
  3. Same file, EnvironmentRoutingModeEnum: a new enum, so no existing consumer decodes it. CustomDomainServiceResponse.type reuses ServiceTypeEnum, and only APPLICATION, CONTAINER and HELM occur.
🧠 Approach · document as built, with clean generated type names
  • port uses allOf + nullable without a sibling description. With a description, the Go generator creates a one-off CustomDomainRouteResponsePort type; without it, the field is NullableCustomDomainPortResponse. The null rule moved into the route's description.
  • Schema names match the q-core DTOs. None of them existed in the spec before.
  • Not in this PR: statusCount, the status[] filter and the routingStatus fields (QOV-2547, not shipped). The console, CLI and Terraform provider can adopt listOrganizationCustomDomain once the clients are published.

✅ Verified:

  • Spectral with its built-in OAS rules reports no new findings against main. npm test could not run because its Stoplight ruleset URL returns 404.
  • I generated the TypeScript (7.8.0), Go (7.6.0) and Rust (7.20.0) clients locally, and all three build.
  • "Generate API Clients" is green. Its Rust build step fails, but the step does not stop the job on errors, and main fails the same way: uuid@1.29.3 requires rustc 1.89 and CI has 1.88. This change does not cause it.

🧪 How to test

  1. Take an organization with custom domains, an API token of an organization admin, and an API token of a non-admin member.
  2. With the admin token, run curl -H "Authorization: Token $QOVERY_TOKEN" "https://api.qovery.com/organization/<org-id>/customDomain?pageSize=5".
  3. Check the response against the schema in the API doc preview: an envelope with results, page, page_size and total_count, and each route with service, port (or null), path and path_rewrite.
  4. Repeat with the non-admin token and confirm a 403.