Coordinates schema not valid for openapi 3.0? #113
Replies: 1 comment
-
@jxv3386 what version of geojson-pydantic are you using? I'm also not sure to really understand the issue, would you be able to provide a proper reproducible example. If there are some issues it might be in pydantic itself, it seems there has been change in pydantic 1.10 🤷 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently using FastApi to create a openapi 3.0.2 spec
Dont know if im doing something wrong but created a simple geometry class
class BasemapArea(BaseModel): id: str name: str geometry: Point
and the resulting schema json is invalid
"coordinates": { "title": "Coordinates", "anyOf": [ { "type": "array", "minItems": 2, "maxItems": 2, "items": [ { "type": "number" }, { "type": "number" } ] }, { "type": "array", "minItems": 3, "maxItems": 3, "items": [ { "type": "number" }, { "type": "number" }, { "type": "number" } ] } ] } }
I think the items lists should not be a list of dictionarys of numbers but just a dict of type number
"coordinates": { "title": "Coordinates", "anyOf": [ { "maxItems": 2, "minItems": 2, "type": "array", "items": { "type": "number" } }, { "maxItems": 3, "minItems": 3, "type": "array", "items": { "type": "number" } } ]
Another issue im having is the additional const field in the properties.type is not valid
Beta Was this translation helpful? Give feedback.
All reactions