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

Stricten requirements on base info fields #1492

Open
merkys opened this issue Feb 2, 2023 · 4 comments
Open

Stricten requirements on base info fields #1492

merkys opened this issue Feb 2, 2023 · 4 comments

Comments

@merkys
Copy link
Member

merkys commented Feb 2, 2023

The cited fields in OPTIMADE have quite strictly defined values, IMO:

formats: List[str] = StrictField(
default=["json"], description="List of available output formats."
)
available_endpoints: List[str] = StrictField(
...,
description="List of available endpoints (i.e., the string to be appended to the versioned base URL).",
)
entry_types_by_format: Dict[str, List[str]] = StrictField(
..., description="Available entry endpoints as a function of output formats."
)

  • 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
@ml-evs
Copy link
Member

ml-evs commented Feb 2, 2023

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
Copy link
Member Author

merkys commented Feb 2, 2023

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

@ml-evs
Copy link
Member

ml-evs commented Feb 2, 2023

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

@merkys
Copy link
Member Author

merkys commented Feb 2, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants