Skip to content

chore(openapi): regenerate committed spec — adds the missing v1 surface - #115

Merged
pparage merged 1 commit into
devfrom
chore/regen-openapi
Aug 5, 2026
Merged

chore(openapi): regenerate committed spec — adds the missing v1 surface#115
pparage merged 1 commit into
devfrom
chore/regen-openapi

Conversation

@pparage

@pparage pparage commented Aug 5, 2026

Copy link
Copy Markdown
Member

The root openapi.json is what bootstraps the Kong gateway config, but nothing regenerates or verifies it — so it had drifted all the way back to the pre-v1 API. Regenerated with the recipe in README.md.

84 → 121 paths, purely additive — 0 removed. Everything gained is /v1:

  • deployments — list/create/get, attempts, cancel, events (SSE), preflight, rollback, snapshot(s), timings, per-team reset
  • projects — CRUD, compose, validate
  • catalogsources (+refresh), entries
  • proxmoxhosts (+health), vms (+status/{action}, snapshots, rollback), storage (+content, download-url), tasks/{upid}/status
  • opshealth, health/ready, admin/stats, admin/retention

No behaviour change — generated artifact only. pytest is unchanged from dev (the single test_expand_replication_vectors failure is the cross-repo overlay drift fixed in #114).

Sequencing note: #113 removes 5 v0 bundle routes and edits this file surgically. Once both land I'll re-run the regen so the spec matches the merged surface rather than resolving the two by hand.

Nothing regenerates this file automatically — it will rot again. A drift check mirroring the generated.py one in schema-and-operators would prevent that; happy to add it if wanted (it would start failing any PR that changes routes without regenerating).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d93799602a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread openapi.json
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the Range42 envelope for v1 422 responses

This newly added v1 operation documents validation failures as FastAPI's default HTTPValidationError, but app/core/errors.py:134-151 installs a RequestValidationError handler that returns the canonical Range42 envelope (error, message, code, details, trace_id, timestamp) promised for every v1 error in README.md:423-424. Clients generated from this committed gateway spec will deserialize 422s with the wrong shape for invalid project payloads and the other added v1 routes that copy this response.

Useful? React with 👍 / 👎.

Comment thread openapi.json
Comment on lines +4483 to +4485
"content": {
"application/json": {
"schema": {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Document the events stream as text/event-stream

The /v1/deployments/{deployment_id}/events route returns EventSourceResponse from app/routes/v1/deployments/events.py:104-105, so successful responses are SSE (text/event-stream), not JSON. Since this committed spec is used to bootstrap the gateway and generated clients, advertising application/json here will make consumers treat the long-lived event stream as a JSON response instead of opening/parsing SSE events.

Useful? React with 👍 / 👎.

The root openapi.json bootstraps the Kong gateway config but nothing
regenerates or verifies it, so it had drifted to the pre-v1 API: 84
paths, none of them /v1. Regenerated per the README recipe.

84 -> 121 paths, purely additive (0 removed): the whole v1 surface —
deployments (incl. SSE events, preflight, rollback, snapshots, timings),
projects, catalog sources/entries, proxmox hosts/vms/storage/tasks,
health and admin stats/retention.
@pparage
pparage force-pushed the chore/regen-openapi branch from d937996 to a40646c Compare August 5, 2026 21:27
@pparage
pparage merged commit dd50d29 into dev Aug 5, 2026
1 check passed
@pparage

pparage commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

Both Codex points are correct, and both are defects in the app, not in the regeneration — the spec faithfully reports what FastAPI declares today, so they need route-level fixes rather than a different regen. Filing them as follow-ups rather than holding this PR, since merging it strictly improves the committed spec (the whole /v1 surface was missing).

  1. 422 shape. app/core/errors.py installs a RequestValidationError handler returning the Range42 envelope (error/message/code/details/trace_id/timestamp), but the routes still advertise FastAPI's default HTTPValidationError. Every v1 operation is affected, not just POST /v1/projects/. Fix is a shared responses={422: {"model": Range42Error}} (or a router-level default) so generated clients deserialise the real body.
  2. SSE content type. GET /v1/deployments/{id}/events returns EventSourceResponse but documents application/json. Needs response_class=EventSourceResponse / an explicit text/event-stream response so consumers open a stream instead of awaiting a JSON body.

Worth noting these are exactly the kind of drift that went unnoticed because nothing regenerates or checks this file — it had rotted back to the pre-v1 API (84 paths, zero /v1). A drift gate mirroring the generated.py one would catch both the staleness and any future mismatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant