Bug Report
The migration to pydantic v2 will introduce a regression with respect to the xAPI specification. Following the migration, xAPI statements cannot contain empty string values even in an "extensions" field. This behavior is contrary to the specification and must be reverted.
The reason for the regression is that model_config has str_min_length=1, which previously (pydantic <2) did not apply to values defined as dicts (when setting an extension) but now (pydantic >2) does.
One solution could be to create a custom class (RootModel[Dict] ?) for extensions with a custom config.
TODO:
Bug Report
The migration to pydantic v2 will introduce a regression with respect to the xAPI specification. Following the migration, xAPI statements cannot contain empty string values even in an "extensions" field. This behavior is contrary to the specification and must be reverted.
The reason for the regression is that
model_confighasstr_min_length=1, which previously (pydantic <2) did not apply to values defined as dicts (when setting an extension) but now (pydantic >2) does.One solution could be to create a custom class (
RootModel[Dict]?) for extensions with a custom config.TODO:
LanguageMap = Dict[LanguageTag, NonEmptyStrictStr]is not used in extensions (as it forces a non empty string""to values intest_models_xapi_base_statement_with_valid_null_values