-
-
Notifications
You must be signed in to change notification settings - Fork 137
can't get to validate GeoJSON features using openapi-core
, oneOf
and enum
#103
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
Comments
Hello,
This might look strange to a customer reading the spec, but I'm gonna stick to that for the moment. Yet I publish this because I hope it can help you! |
@michalmiesiak thanks for the report. The only difference between |
@p1c2u any news about this feature? |
@gigimon I'm in process of rewriting schema validation part that should fix most of issues related to this area including |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I'm trying to integrate
openapi-core
with the test suite of my Flask API, so that all requests that I test are verified against the specification. Before I used theflex.core
lib andSwagger 2.0
specification, but now I must pass on toOpenApi 3.0
(not supported byflex
), so I choseopenapi-core
(my current version:0.7.1
). I use theFlaskOpenAPIRequest
wrapper class on theflask.request
object, within the correct context etc.My problem is that I can't validate any HTTP requests that contain GeoJSON geometries in their bodies. The library "thinks" that more than one schema satisfies the specification whereas it is not the case. Thus, the validation always fails. The error I get is:
I think this might be due to a bug with
oneOf
choosing from schemas that containenum
, but maybe I'm doing something wrong?Below details on requests that I make.
So, my request has a JSON body:
NewLayer
are basically lists of geojson geometries with some additional properties, like in an example test body that I send:To resume briefly the problem, each geometry element in my OpenApi specification has a choice of one of 5 schemas.
The elements that "conflict" are
MultiLineString
andPolygon
(if I remove any of these, all works!).Yet, they are different because they have a
type
field that is anenum
with only one allowed value! So both can never be valid both at a time.On the other hand, their
coordinates
fields can be both valid a time. That's what makes me think thatenum
fields are not handled correctly by the .Below the definitions:
I will be very glad for any help! :-)
Thank you.
The text was updated successfully, but these errors were encountered: