Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra validators for Canvas/HWD properties #144

Open
digitaldogsbody opened this issue Dec 15, 2022 · 1 comment
Open

Extra validators for Canvas/HWD properties #144

digitaldogsbody opened this issue Dec 15, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@digitaldogsbody
Copy link
Member

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

@digitaldogsbody digitaldogsbody added the enhancement New feature or request label Dec 15, 2022
@glenrobson glenrobson added the discuss For discussion in next catchup meeting label Jan 13, 2023
@glenrobson
Copy link
Contributor

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

@digitaldogsbody digitaldogsbody self-assigned this Jan 13, 2023
@glenrobson glenrobson removed the discuss For discussion in next catchup meeting label Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants