Skip to content

feat: SchemaRef and RenameSchemasFunc, which notion and pixellab both write - #19

Merged
MarkRosemaker merged 2 commits into
mainfrom
feat/transform-helpers
Nov 13, 2026
Merged

MarkRosemaker merged 2 commits into
mainfrom
feat/transform-helpers

Conversation

@MarkRosemaker

@MarkRosemaker MarkRosemaker commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Two helpers that go-api-libs/notion and pixellab each wrote for themselves:

  • SchemaRef(doc, name): a $ref schema pointing at a component, with its Value set. notion's refTo and pixellab's hand-built references in referPlainStrings and narrowRefs are the same thing.
  • RenameSchemasFunc(doc, rename): renames every component by a rule, through RenameSchemas. notion's stripSuffixes and pixellab's goNames each build the map themselves.

Left out, because only one library uses each of them or they're no longer needed:

  • MoveToComponents: notion's alone (openapi-flatten's version picks a free name instead).
  • MergeSchemas: is just Replace plus RedirectSchemas.
  • RemoveNullAlternatives: no longer needed once openapi-codegen#72 and openapi-flatten#13 are in, since they read X or null as X.
  • RemoveEmptyJSON: pixellab's alone.

Tests

  • tests for both helpers, including a rename onto a taken name;
  • make ready passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_019QCb1AfnATvpBQCH3PrX7Y

MoveToComponents, SchemaRef, RenameSchemasFunc and MergeSchemas, which
go-api-libs/notion and pixellab each wrote to shape their specification,
and RemoveNullAlternatives and RemoveEmptyJSON, which undo what FastAPI
writes. Both libraries generate the same specification and code with
these as with their own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019QCb1AfnATvpBQCH3PrX7Y
SchemaRef and RenameSchemasFunc stay: notion and pixellab both build
references and rename by a rule. MoveToComponents is notion's alone, and
MergeSchemas is Replace and RedirectSchemas. RemoveNullAlternatives is no
longer needed, now that codegen and flatten read X or null as X, and
RemoveEmptyJSON is pixellab's alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019QCb1AfnATvpBQCH3PrX7Y
@MarkRosemaker MarkRosemaker changed the title feat: the transform helpers libraries wrote for themselves feat: SchemaRef and RenameSchemasFunc, which notion and pixellab both write Nov 13, 2026
@MarkRosemaker
MarkRosemaker merged commit 918b985 into main Nov 13, 2026
1 check passed
@MarkRosemaker
MarkRosemaker deleted the feat/transform-helpers branch November 13, 2026 18:55
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.

2 participants