Skip to content

fix(schema_types): optional fields as X | None in shared types - #38

Draft
JulienChampagnol wants to merge 3 commits into
nextfrom
feat/component_light_viewables
Draft

JulienChampagnol wants to merge 3 commits into
nextfrom
feat/component_light_viewables

Conversation

@JulienChampagnol

Copy link
Copy Markdown
Member

Summary

  • The schema-types generator writes optional fields as X | None instead of Optional[X] (ruff UP045), the same way it already rewrites List[ to list[.
  • dataclassKey applies the same rewrite, so a shared type holding an optional field (e.g. MeshComponent.binary_light_viewable) is still recognized in route schemas instead of being copied into each module.

Needed by OpenGeodeWeb-Back feat/component_light_viewables (per mesh component light viewables).

Test plan

  • Regenerated OpenGeodeWeb-Back: schema_types.py is ruff-clean and route schemas import the shared MeshComponent
  • Regenerated OpenGeodeWeb-Viewer and Microservice: no diff
  • oxfmt / oxlint clean

🤖 Generated with Claude Code

JulienChampagnol and others added 3 commits December 2, 2026 10:50
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quicktype names a shared type used by several fields of a schema after
each field (e.g. CornersColorClass for a ColorRGB): a nested dataclass with
exactly the fields of one shared type is now replaced by it, as TypeScript
interfaces already are. The params and response classes of a route are
still matched by name only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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