forked from smart-on-fhir/fhir-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't workinggenerator-pydanticCode generator for python pydanticCode generator for python pydantic
Description
ATM the validation of empty object is only working in dict form.
Example:
RootModel(
field_a="a", list_items=[ListItem(), ListItem(), ListItem()]
).dict() == {"field_a": "a"}does not raise an validation error. But it actually should.
RootModel(**{"field_a": "a", "list_items": [{}, {}, {}]})Does.
The problem is in resource header strip_empty_items since it only takes care about the dict representation of the model, which is not executed in case of the construction via Objects. A similar functionality needs to be implemented on a Pydantic object level without the pre parameter in the validator. This should then cover the json variant as well.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggenerator-pydanticCode generator for python pydanticCode generator for python pydantic