feat: expose parser and render graph APIs#212
Open
josh-burton wants to merge 2 commits into
Open
Conversation
Summary: - add parser-only loadRenderSpec entrypoint for custom renderers - expose component schema iteration and local schema lookup helpers - publish render graph types and traversal helpers for downstream rendering Rationale: - downstream generators can reuse SpaceGen parsing and graph construction without importing src/ or invoking the built-in template renderer - the public parser surface is narrowed to supported schema/component types Tests: - dart analyze - dart test Co-Authored-By: GPT-5 <gpt-5@openai.com> feat: expose component schema render roots Summary: - Add top-level component schemas to the resolved and rendered spec graph. - Include component schema roots in render tree traversal and public schema collection. - Export collectAllSchemas from the public package API. - Cover unreferenced component schemas through the public parser/render API. Rationale: - Custom renderers need to render named component schemas even when no API path references them. - Component roots are declarations, not typed use sites, so the naming pass keeps existing oneOf variant smooshing behavior intact. Constraint: Preserve existing FileRenderer behavior and oneOf naming semantics. Rejected: Only export collectAllSchemas | this would still leave unreferenced component schemas absent from the render graph. Rejected: Count component roots as ordinary schema references | this breaks exclusive-use variant smooshing. Confidence: high Scope-risk: moderate Tests: - dart analyze - dart test Co-Authored-By: GPT-5 <gpt-5@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for creating space_gen! I have a api client generator that parses an OpenApi spec and then uses dart code_builder to generate the implementation.
Until now I've been using another dart package to parse the OpenApi specs, but space_gen is more complete and better fits my use case.
I ran into a few minor issues which I have addressed in this PR:
I'm more than happy to make any tweaks, or refactorings :)