Skip to content

fix(openapi): drop per-item x-internal markers on private routes - #1221

Open
danielpeng1 wants to merge 1 commit into
masterfrom
WCN-4282-inherit-internal-on-private-routes
Open

danielpeng1 wants to merge 1 commit into
masterfrom
WCN-4282-inherit-internal-on-private-routes

Conversation

@danielpeng1

Copy link
Copy Markdown

We noticed that internal endpoints were showing up in the generated API spec with x-internal: true stamped on every single field, even though the endpoint itself is already marked internal. It doesn't change what gets hidden — the fields inherit privacy from the endpoint — so it was effectively just bloat.

  • Routes marked @private now emit x-internal: true only on the endpoint itself. Their parameters, request body fields, and response fields no longer repeat it.
  • Per-item @private/@public markers still work exactly as before on public routes and in reusable components schemas, since those aren't tied to a single route.
  • Documented the inheritance rule in the README.

Tests

  • Added a test that generates a @private route with privately-tagged params and body fields (plus one @public field) and asserts no item-level x-internal is emitted, while the endpoint itself stays marked and the shared component schema keeps its markers.
  • Existing tests confirm per-item markers still appear on routes that aren't @private.

Ticket: WCN-4282

@danielpeng1 danielpeng1 self-assigned this Nov 25, 2026
@linear-code

linear-code Bot commented Nov 25, 2026

Copy link
Copy Markdown

WCN-4282

@danielpeng1

Copy link
Copy Markdown
Author

@claude

@danielpeng1
danielpeng1 marked this pull request as ready for review November 25, 2026 18:02
@danielpeng1
danielpeng1 requested a review from a team as a code owner November 25, 2026 18:02

@claude claude 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.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

This branch has not been deployed

No deployments
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