Skip to content

feat: expose parser and render graph APIs#212

Open
josh-burton wants to merge 2 commits into
eseidel:mainfrom
josh-burton:fix/expose-component-schemas
Open

feat: expose parser and render graph APIs#212
josh-burton wants to merge 2 commits into
eseidel:mainfrom
josh-burton:fix/expose-component-schemas

Conversation

@josh-burton

Copy link
Copy Markdown

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:

  • missing exports
  • unable to read unreferenced component schemas
  • no parser-only entrypoint

I'm more than happy to make any tweaks, or refactorings :)

josh-burton and others added 2 commits June 10, 2026 11:24
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>
@eseidel eseidel self-requested a review June 11, 2026 18:27
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