optimade-python-tools icon indicating copy to clipboard operation
optimade-python-tools copied to clipboard

Stricten requirements on base info fields

Open merkys opened this issue 1 year ago • 4 comments

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

  • Items of formats must match regex ^(json|_.*)$
  • Items of available_endpoints are as well limited to the supported endpoints plus ^_
  • entry_types_by_format are essentially limited by the same requirements

merkys avatar Feb 02 '23 14:02 merkys

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

ml-evs avatar Feb 02 '23 14:02 ml-evs

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

merkys avatar Feb 02 '23 14:02 merkys

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

ml-evs avatar Feb 02 '23 14:02 ml-evs

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

merkys avatar Feb 02 '23 15:02 merkys