Skip to content

Remove undocumented filtering from codegen, filter at blueprint creation#451

Merged
razor-x merged 1 commit into
mainfrom
claude/blueprint-undocumented-filters-xkxzya
Jul 24, 2026
Merged

Remove undocumented filtering from codegen, filter at blueprint creation#451
razor-x merged 1 commit into
mainfrom
claude/blueprint-undocumented-filters-xkxzya

Conversation

@razor-x

@razor-x razor-x commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

This PR refactors the undocumented content filtering logic by moving it upstream to the blueprint creation step, rather than filtering throughout the codegen code. This simplifies the codegen by removing scattered isUndocumented checks and documentedProperties filtering calls.

Key Changes

  • Removed documentedProperties helper function that filtered out undocumented properties - this filtering now happens at blueprint creation time
  • Simplified resource model generation by removing isUndocumented checks for resources, events, and action attempts
  • Simplified route generation by removing isUndocumented checks for routes and endpoints, and removing parameter filtering
  • Updated blueprint initialization in smith.ts to use createBlueprint with omitUndocumented: true option, ensuring the blueprint only contains public API elements before codegen processes it

Implementation Details

  • The createBlueprint function from @seamapi/blueprint is now called with omitUndocumented: true, which pre-filters all undocumented resources, endpoints, parameters, and properties
  • This eliminates the need for defensive filtering throughout the codegen pipeline
  • The codegen now operates on a "clean" blueprint that only contains documented elements, making the code simpler and more maintainable
  • Changed from using the blueprint plugin to directly passing the blueprint via metadata

https://claude.ai/code/session_01BrQiAv7j9XMWD12S9ax9Bt

Enable the `omitUndocumented` option when creating the blueprint so
undocumented routes, endpoints, parameters, resources, events, action
attempts, and properties are stripped upstream. This removes the need for
the manual `isUndocumented` filters scattered throughout the codegen.

Since @seamapi/smith's blueprint plugin does not forward this option,
build the blueprint directly with `createBlueprint` and pass it in via
Metalsmith metadata.

Generated output is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BrQiAv7j9XMWD12S9ax9Bt
@razor-x
razor-x marked this pull request as ready for review July 24, 2026 15:30
@razor-x
razor-x merged commit eeb77bf into main Jul 24, 2026
5 checks passed
@razor-x
razor-x deleted the claude/blueprint-undocumented-filters-xkxzya branch July 24, 2026 15:31
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