We have these validators in our classes:
@model_validator(mode="after")
def check_oneof(cls, values):
return cls._validate_field_groups(values)
This does not seem to work because of how betterproto Messages are instantiated from json:
Bundle().from_json(data)
from_json() is an instance method so I believe the validator runs before from_json() and fails if there are any groups in the model:
pydantic_core._pydantic_core.ValidationError: 1 validation error for Bundle
Value error, Group content has no value; all fields are None [type=value_error, input_value=ArgsKwargs(()), input_type=ArgsKwargs]
For further information visit https://errors.pydantic.dev/2.10/v/value_error