Skip to content

fix(schemas): shared schema types - #206

Merged
BenPinet merged 14 commits into
nextfrom
fix/shared_types
Nov 20, 2026
Merged

BenPinet merged 14 commits into
nextfrom
fix/shared_types

Conversation

@JulienChampagnol

@JulienChampagnol JulienChampagnol commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Uses the shared schema types of OpenGeodeWeb-Microservice (Geode-solutions/OpenGeodeWeb-Microservice#35).

  • Defines in src/opengeodeweb_viewer/schema_types.json, exported as @geode/opengeodeweb-viewer/schema_types and opengeodeweb_viewer.schema_types:
    • ColorRGB, ColorRGBA, ColorMapPoints, Visibility, Opacity, PointSize, EdgeWidth, BlockIds (an array of ViewerId), AttributeItem, AttributeRangeMinimum, AttributeRangeMaximum;
    • ViewerId, AttributeName, Filename, Point3D, also defined (identically) by Back.
  • ColorRGB is {red, green, blue} and ColorRGBA extends it with alpha. ⚠️ set_background_color and set_text_style now take red/green/blue instead of r/g/b; Front and Vease are updated in their own PRs.
  • RPC schemas only name the shared types, e.g. "color": {"title": "ColorRGBA"}: about 2400 duplicated lines removed. schema_definitions.json ships with the package so that the RPCs validate the full schemas at runtime.
  • The generated code names them: id: DataId, opacity: Opacity, minimum: AttributeRangeMinimum instead of str/float.
  • Test data: the ids are now checked against their type, so the blocks of cube.vtm get valid uuids.

Test plan

  • ruff clean, mypy clean (mypy -p opengeodeweb_viewer)
  • 310 tests pass
  • The combined JSON schemas are the same as with the full schemas (plus the titles)

🤖 Generated with Claude Code

JulienChampagnol and others added 10 commits November 19, 2026 15:15
ColorRGB is now {red, green, blue} and ColorRGBA extends it with alpha. They are
imported from @geode/opengeodeweb-viewer/schema_types or opengeodeweb_viewer.schema_types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The colors of set_background_color and set_text_style are now red/green/blue,
like every other color.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ids are now checked against their schema type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bounds of the range the color map of an attribute covers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OpenGeodeWeb-Microservice only defines DataId and GeodeId.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JulienChampagnol and others added 2 commits November 20, 2026 10:55
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…block

Like before BlockIds, their block_ids may be empty (e.g. to unhighlight every
block): an array of ViewerId, BlockIds requiring at least one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They are the picked ones among the ids of its params, which are DataId.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@BenPinet
BenPinet merged commit d0df40f into next Nov 20, 2026
29 checks passed
@BenPinet
BenPinet deleted the fix/shared_types branch November 20, 2026 16:28
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.

3 participants