Skip to content

Source map comments in generated code #16

Description

@qwexvf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions