iiif-prezi/iiif-prezi3

Extra validators for Canvas/HWD properties

Opened this issue · 1 comments

The specification as written says

A Canvas MUST have a rectangular aspect ratio (described with the height and width properties) and/or a duration to provide an extent in time.

Although the JSON Schema validates this (https://github.com/IIIF/presentation-validator/blob/main/schema/iiif_3_0.json#L635-L643) with anyOf hwd and making h&w dependent on each other - this validation does not come through when the Pydantic model is generated by datamodel-code-generator and all three fields end up being wrapped in Optional.

We could build a custom validator for this (https://docs.pydantic.dev/usage/validators/) and add it to the class with the new skeleton modification script

Discussed this on the call 13th Jan we think this would be useful and could be injected with the skeleton agenda.