specverb: make openapi3.T the engine IR (retire the swaggerSpec adapter) #124

Closed
opened 2026-06-09 06:24:03 +00:00 by coilysiren · 1 comment
Owner

Follow-up to the kin-openapi parse-layer tracer (f31117f, ward#74).

Context

The tracer swapped specverb's parse layer to kin-openapi but kept the legacy swaggerSpec IR as the boundary: parseSwagger loads and derefs via kin, then lowers the resolved openapi3.T back into the old inlined structs (swaggerSpec / swaggerOp / swaggerSchema) so the emit path stayed untouched. That kept the tracer thin and proved parity on the org slice.

The work

Make *openapi3.T (or a thin typed projection of it) the engine IR directly, retiring the lowerSpec / inlineSchema / inlineBody adapter in http/specverb/swagger.go. This unlocks what the M0 lowering deliberately drops:

  • Nested / non-scalar body fields (M0 collapses them to type and skips them).
  • Query and header parameters promoted to flags (M0 reads only path params and body scalars).
  • Required-field fidelity straight from the resolved schema.

Why now / why not yet

Not load-bearing for the org and repo slices, so it stayed out of the tracer. It becomes necessary as the generator fans out to the long forgejo tail (the richer create/edit bodies in #74) and the PATCH-edit / multipart shapes in ward#73. File it so the adapter is a named seam, not a silent shortcut.

Design: cli-guard#75.

Follow-up to the kin-openapi parse-layer tracer (`f31117f`, ward#74). ## Context The tracer swapped specverb's parse layer to kin-openapi but kept the legacy `swaggerSpec` IR as the boundary: `parseSwagger` loads and derefs via kin, then **lowers** the resolved `openapi3.T` back into the old inlined structs (`swaggerSpec` / `swaggerOp` / `swaggerSchema`) so the emit path stayed untouched. That kept the tracer thin and proved parity on the org slice. ## The work Make `*openapi3.T` (or a thin typed projection of it) the engine IR directly, retiring the `lowerSpec` / `inlineSchema` / `inlineBody` adapter in `http/specverb/swagger.go`. This unlocks what the M0 lowering deliberately drops: - **Nested / non-scalar body fields** (M0 collapses them to type and skips them). - **Query and header parameters** promoted to flags (M0 reads only path params and body scalars). - **Required-field fidelity** straight from the resolved schema. ## Why now / why not yet Not load-bearing for the org and repo slices, so it stayed out of the tracer. It becomes necessary as the generator fans out to the long forgejo tail (the richer create/edit bodies in #74) and the PATCH-edit / multipart shapes in ward#73. File it so the adapter is a named seam, not a silent shortcut. Design: cli-guard#75.
coilysiren added
P3
and removed
P2
labels 2026-06-17 08:39:37 +00:00
Member

🔒 Reserved by ward agent claude — container ward-cli-guard-issue-124-claude-d4caf6cc on host kais-macbook-pro.local is carrying this issue (reserved 2026-06-18T07:34:33Z). Concurrent ward agent runs are blocked until it finishes or the reservation goes stale (2h0m0s TTL); --force overrides.

— Claude (she/her), via ward agent

<!-- ward-agent-reservation --> 🔒 Reserved by `ward agent claude` — container `ward-cli-guard-issue-124-claude-d4caf6cc` on host `kais-macbook-pro.local` is carrying this issue (reserved 2026-06-18T07:34:33Z). Concurrent `ward agent` runs are blocked until it finishes or the reservation goes stale (2h0m0s TTL); `--force` overrides. <!-- ward-agent-signature --> — Claude (she/her), via `ward agent`
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-flight-deck/cli-guard#124
No description provided.