fix: fixes annotation definition in anyof parser #71

Merged
HideyoshiNakazone merged 1 commits from fix/fixes-annotation-definition-anyof into main 2025-11-28 21:30:38 +00:00
HideyoshiNakazone commented 2025-11-28 21:30:11 +00:00 (Migrated from github.com)

This pull request refactors how default values are handled when constructing union types with field validators in the from_properties_impl method of jambo/parser/anyof_type_parser.py. The main change is to explicitly extract and set default values for each sub-type, ensuring that defaults are correctly applied in the annotated fields.

Field validator and default value handling:

  • Refactored the construction of field_types to explicitly extract and set the default value from each sub-type's properties, using ... as a fallback when no default is provided. This ensures that default values are correctly passed to the Field constructor for each annotated type.
This pull request refactors how default values are handled when constructing union types with field validators in the `from_properties_impl` method of `jambo/parser/anyof_type_parser.py`. The main change is to explicitly extract and set default values for each sub-type, ensuring that defaults are correctly applied in the annotated fields. Field validator and default value handling: * Refactored the construction of `field_types` to explicitly extract and set the `default` value from each sub-type's properties, using `...` as a fallback when no default is provided. This ensures that default values are correctly passed to the `Field` constructor for each annotated type.
HideyoshiNakazone commented 2025-11-28 21:31:15 +00:00 (Migrated from github.com)

Solves #69

Solves #69
Sign in to join this conversation.