iiif-prezi / iiif-prezi3

IIIF Presentation API 3 Python Library
https://iiif-prezi.github.io/iiif-prezi3/
Apache License 2.0
28 stars 14 forks source link

Investigate `--strict-nullable` option in datamodel-code-generator #143

Closed digitaldogsbody closed 1 year ago

digitaldogsbody commented 1 year ago

At the moment we have some fields that are required, such as type coming through as Optional with a default set.

It looks like datamodel-code-generator has an argument that can make these fields required while preserving the default. See https://github.com/koxudaxi/datamodel-code-generator/issues/757

Although we have a constrained string for type, I think it should still work - so we should investigate generating the skeleton with this and seeing if everything still works!

glenrobson commented 1 year ago

Discussed in call 13th Jan. Would be useful to investigate.

digitaldogsbody commented 1 year ago

This worked perfectly first time, type no longer gets the Optional[] annotation and everything still works :grinning: