Repository navigation
Title: Fix serialization validation errors and enum metadata nullability - #67
Merged
Merged
Conversation
Allow cleanup when root metadata has not been created, preserving ConditionViolationError and ValidationError. Add regression coverage for invalid choices and validation options.
…sis warnings Use WrapValidator to accept None for optional enums while rejecting it for non-nullable fields. Skip enum metadata serialization for None. Add regression coverage for validation, serialization, and metadata round-trips. Address Ruff, Pylint, and Pylance warnings across the runtime, cached JSON deserializer, and tests. Clean up imports, typing, logging, formatting, and exception handling. Raise TypeError for unsupported rune_deserialize input types. Fixes #57
plamen-neykov
requested review from
davidalk,
dschwartznyc and
hugohills-regnosys
November 10, 2026 19:26
plamen-neykov
marked this pull request as draft
November 10, 2026 19:27
Call the enum serialization handler with only the enum value instead of passing SerializationInfo as the index_key argument. Remove the unused info parameter from the wrap serializer callback. Fix serialization failures on Pydantic 2.14.3 while preserving compatibility with the existing minimum supported version.
plamen-neykov
marked this pull request as ready for review
November 10, 2026 20:33
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.
This PR fixes validation error handling, optional enum metadata, and enum serialization compatibility with newer Pydantic releases.
It also addresses Ruff, Pylint, and Pylance warnings through import cleanup, updated typing, module-level logging, formatting, and simpler exception handling. Unsupported input types passed to rune_deserialize() now raise TypeError instead of ValueError.
Regression coverage includes invalid choices, preservation of validation exceptions, validation options, optional enum defaults, null serialization, and enum metadata round-trips.
Validation on Pydantic 2.14.3: 399 passed, 19 skipped across the tracked test suite.
Fixes #56 and #57.