You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that we are using (approximately) Tuple[PERIODICITY, PERIODICITY, PERIODICITY] when constructing dimension_types, but the pydantic docs (link below) states that:
And equivalently for any other set of subtypes. Note: If using schemas for OpenAPI, you shouldn't use this declaration, as it would not be valid in OpenAPI (although it is valid in JSON Schema).
Steps to take for the fix:
Run an openapi validator in our CI.
Switch away from Tuple throughout our API models (what should we use instead?)
Okay, I think I may have found the issue here.
According to the OpenAPI specification the items property of a Schema Object MUST be an object. But for dimension_types, it's an array.
Edit: The issue is also mentioned in pydantic's documentation here (see in the table for Tuple).
This is the cause of Materials-Consortia/OPTIMADE#314, which @CasperWA has summarised below.
The problem is that we are using (approximately)
Tuple[PERIODICITY, PERIODICITY, PERIODICITY]
when constructingdimension_types
, but the pydantic docs (link below) states that:Steps to take for the fix:
Tuple
throughout our API models (what should we use instead?)From @CasperWA:
Originally posted by @CasperWA in #477 (comment)
The text was updated successfully, but these errors were encountered: