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
When using the library, a common pattern is to set an auto language across the manifest so that you don't need to set the language each time. For instance:
Traceback (most recent call last):
File "/Users/mark.baggett/code/iiif-prezi3/testing3.py", line 14, in <module>
natural_light = ResourceItem(
id="https://iiif.io/api/image/3.0/example/reference/421e65be2ce95439b3ad6ef1f2ab87a9-dee-natural/full/max/0/default.jpg",
...<4 lines>...
label="Natural Light"
)
File "/Users/mark.baggett/code/iiif-prezi3/iiif_prezi3/base.py", line 46, in __init__
super().__init__(**kw)
~~~~~~~~~~~~~~~~^^^^^^
File "/Users/mark.baggett/code/iiif-prezi3/venv/lib/python3.13/site-packages/pydantic/main.py", line 341, in __init__
raise validation_error
pydantic.error_wrappers.ValidationError: 2 validation errors for ResourceItem
label -> __root__
value is not a valid dict (type=type_error.dict)
label -> __root__
value is not a valid dict (type=type_error.dict)
Expected behaviour:
I expected to be able to set the language for the ResourceItem with config.configs['helpers.auto_fields.AutoLang'].auto_lang = "en".
Observed behaviour:
An error was raised:
Traceback (most recent call last):
File "/Users/mark.baggett/code/iiif-prezi3/testing3.py", line 14, in <module>
natural_light = ResourceItem(
id="https://iiif.io/api/image/3.0/example/reference/421e65be2ce95439b3ad6ef1f2ab87a9-dee-natural/full/max/0/default.jpg",
...<4 lines>...
label="Natural Light"
)
File "/Users/mark.baggett/code/iiif-prezi3/iiif_prezi3/base.py", line 46, in __init__
super().__init__(**kw)
~~~~~~~~~~~~~~~~^^^^^^
File "/Users/mark.baggett/code/iiif-prezi3/venv/lib/python3.13/site-packages/pydantic/main.py", line 341, in __init__
raise validation_error
pydantic.error_wrappers.ValidationError: 2 validation errors for ResourceItem
label -> __root__
value is not a valid dict (type=type_error.dict)
label -> __root__
value is not a valid dict (type=type_error.dict)
Potential bug location(s):
Not sure yet. I looked in auto_fields.py, but I haven't spotted the problem yet.
Any other comments:
The text was updated successfully, but these errors were encountered:
When using the library, a common pattern is to set an auto language across the manifest so that you don't need to set the language each time. For instance:
With this, the lang of the label would be 'en'. For some reason, that pattern doesn't work in this case:
Instead, this results in:
Expected behaviour:
I expected to be able to set the language for the
ResourceItem
withconfig.configs['helpers.auto_fields.AutoLang'].auto_lang = "en"
.Observed behaviour:
An error was raised:
Potential bug location(s):
Not sure yet. I looked in
auto_fields.py
, but I haven't spotted the problem yet.Any other comments:
The text was updated successfully, but these errors were encountered: