Materials-Consortia / optimade-python-tools

Tools for implementing and consuming OPTIMADE APIs in Python
https://www.optimade.org/optimade-python-tools/
MIT License
71 stars 44 forks source link

Stricten requirements on base info fields #1492

Open merkys opened 1 year ago

merkys commented 1 year ago

The cited fields in OPTIMADE have quite strictly defined values, IMO: https://github.com/Materials-Consortia/optimade-python-tools/blob/5160a2c47f02d070144a62bd391edc2ca63367af/optimade/models/baseinfo.py#L71-L80

ml-evs commented 1 year ago

Do you mean specifically in the OpenAPI schema @merkys ? We already validate against these constraints (except format, as shown in the linked code) but perhaps we could also patch them into the output schema

merkys commented 1 year ago

Oh right! I meant I would like to see them in the OpenAPI schema.

ml-evs commented 1 year ago

That we can do! I'll take a look before we release 1.2

merkys commented 1 year ago

Thanks, this would be nice to have. Then multipurpose OpenAPI/JSON validators would validate OPTIMADE responses with similar level of strictness.