You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the bool_converter validator is configured as a @root_validator, meaning it does not trigger on field assignments, only on model instantiation.
Even if we add validate_assignments = True to the model config, it will not run the root validator again. We either need to manually override all fields that are quasi-bools (Optional[str] field that accepts "true" and "false".), or we need to find out if we can add a custom validator for a specific type (in this case Optional[str]), but I am not sure how to do that, or if it's even possible.
The text was updated successfully, but these errors were encountered:
Currently, the
bool_converter
validator is configured as a@root_validator
, meaning it does not trigger on field assignments, only on model instantiation.https://github.com/pederhan/harborapi/blob/27900ab5e98c6dc2b7dbb04212414f4edc8d988e/harborapi/models/base.py#L69-L78
Even if we add
validate_assignments = True
to the model config, it will not run the root validator again. We either need to manually override all fields that are quasi-bools (Optional[str]
field that accepts"true"
and"false"
.), or we need to find out if we can add a custom validator for a specific type (in this caseOptional[str]
), but I am not sure how to do that, or if it's even possible.The text was updated successfully, but these errors were encountered: