-
Notifications
You must be signed in to change notification settings - Fork 48
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
SpecError when the result is an array #73
Comments
This might be a stupid question, in which case I'd like to apologize in advance, but … is there a reason why you are not using the jsonschema package for this? |
Admittedly, no. I'm currently evaluating #69, which reimplements a lot of the core logic here using pydantic (a full usable fork which that branch is based off of is here), but that also does not use the jsonschema package. I'll look into it, as that could simplify a lot. |
Looks like the problem here is that the OpenAPI standard defines ax Example type's |
Closes #73 The OpenAPI Standard defines a MediaType.example as [any type](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#media-type-object), and similarly for [Example.value](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#example-object). This library previously did not implement these types in that way, instead accepting a broad set of types, but not _actually_ any type - namely, arrays would break since they are handled specially when parsing the spec. This change moves to `"*"` as the accepted type, which is handled as the special-case "any" type when parsing specs. This results in the expected behavior. A test was added to confirm that arrays are accepted as expected.
Closes #73 The OpenAPI Standard defines a MediaType.example as [any type](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#media-type-object), and similarly for [Example.value](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#example-object). This library previously did not implement these types in that way, instead accepting a broad set of types, but not _actually_ any type - namely, arrays would break since they are handled specially when parsing the spec. This change moves to `"*"` as the accepted type, which is handled as the special-case "any" type when parsing specs. This results in the expected behavior. A test was added to confirm that arrays are accepted as expected.
Closes Dorthu#73 The OpenAPI Standard defines a MediaType.example as [any type](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#media-type-object), and similarly for [Example.value](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#example-object). This library previously did not implement these types in that way, instead accepting a broad set of types, but not _actually_ any type - namely, arrays would break since they are handled specially when parsing the spec. This change moves to `"*"` as the accepted type, which is handled as the special-case "any" type when parsing specs. This results in the expected behavior. A test was added to confirm that arrays are accepted as expected.
The attached file is a reduced version of the spec that exhibits the problem, available from https://marketplace.zoom.us/docs/page-data/api-reference/phone/methods/page-data.json (you need to access
R.result.pageContext.OAS.spec
, then add anemail
field to thecontact
object, duh) where I found the problem.phone.json.txt
The text was updated successfully, but these errors were encountered: