Repository navigation
0.2.8: RegisteredClassChoices validates registry keys in pydantic - #22
Merged
Merged
Conversation
A field annotated with RegisteredClassChoices(family) now accepts a member class or its registry key, emits the key, and publishes the keys as a JSON schema enum, so pydantic-built tool schemas (MCP) accept family-valued fields. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
registered_class_from_key compared each member's to_jsonable spelling, so decoding a family-valued field ran the encoder; scalar registry keys are their own spelling and are read directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The field's schema is a $ref to a definition titled with the family's name, described by its docstring's first paragraph, listing the registry keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
trissim
force-pushed
the
e1-registered-class-pydantic
branch
from
October 11, 2026 17:19
7a96904 to
47e33a2
Compare
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.
A field annotated with
RegisteredClassChoices(family)now accepts a member class or its registry key in pydantic, serializes to the key, and publishes the keys as a JSON-schema enum. OpenHCS's MCP tool schemas expose family-valued config fields (E1 converts more enums to families), and pydantic rejected their registry-key spellings.For OpenHCS consolidation surface E1.
🤖 Generated with Claude Code