Each generated type / endpoint should carry a // source: openapi.yaml:LINE (or JSON pointer) comment pointing back to the spec.
Makes generated code reviewable — when a TS type changes, the reviewer can jump to the spec line that drove it.
Work needed:
- Decoder needs to preserve source location alongside each AST node (or at minimum a JSON pointer).
- IR needs an optional
source field on TypeDef, Endpoint, Field.
- Each emitter pastes it as a leading comment.
Low priority but very high payoff for review ergonomics.
Surfaced during codebase review.
Each generated type / endpoint should carry a
// source: openapi.yaml:LINE(or JSON pointer) comment pointing back to the spec.Makes generated code reviewable — when a TS type changes, the reviewer can jump to the spec line that drove it.
Work needed:
sourcefield onTypeDef,Endpoint,Field.Low priority but very high payoff for review ergonomics.
Surfaced during codebase review.