dlcs / iiif-presentation

Allows for the creation and management of IIIF manifests
MIT License
0 stars 0 forks source link

Correctly validate IIIF through the API #103

Open JackLewis-digirati opened 1 month ago

JackLewis-digirati commented 1 month ago

Currently, the API attempts to "validate" IIIF by serializing and deserializing a collection, which can help strip out unwanted fields. However, this process is slow and not truly validating the IIIF as this can lead to collections being served that aren't valid - ie missing "id" or "@context". I think for now we should ensure that all collections and manifests saved to s3 always have id + context

This ticket is to improve this behaviour

sarahos commented 4 weeks ago

Currently, the iiif-net package is used to validate IIIF collections through serializaion.

That package isn't a iiif validator. There'll likely be IIIF shapes that it can't handle and deserialisation isn't complete

This ticket is to create a proper validator for IIIF collections

the pypi package has a json-schema, could we use that? Or add validation to iiif-net (https://github.com/IIIF/presentation-validator/blob/main/schema/iiif_3_0.json)

donaldgray commented 4 days ago

Note based on conversation wtih @stephenwf : do we need to be lenient/forgiving when handling incoming LanguageMap values?

E.g. should "value": {} be treated as "value": { "none": [""] }? Or do we just handle it as-is? (not this example with deserialize okay but will error when serializing)