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
Your openapi spec declares itself as version 3.0.0, but the document uses a mixture of 3.0.0 and 3.1.0 features, causing validation failures.
Detail
I cannot get OpenAI's latest OpenAPI spec to validate. I've had this for a while, but didn't dig into until today because I received a bug report on it. Specifically, this commit:
OpenAPI v3.0 was based on JSON Schema Draft 05, and JSON Schema has gone through a few drafts since then: Draft 06, Draft 07, and Draft 2019-09. Now thanks to feedback gathered from users and tooling maintainers during the v3.1.0 release candidates, one more small draft was released: Draft 2020-12. This should be the last one for a while and no major changes are planned by the JSON Schema crew, so if all goes well a final release is on the horizon, to avoid any further discrepancies.
changed from a boolean to a number to be consistent with the principle of keyword independence
wherever one of these would be true before, change the value to the corresponding "minimum" or "maximum" value and remove the "minimum"/"maximum" keyword
Below is my full list of validation errors. I do not claim the list is fully correct because when I manually edit the spec to openapi: 3.1.0, my validation errors go away, despite some of the spec apparently being incorrect. I have not looked into this further.
Summary
Your openapi spec declares itself as version
3.0.0
, but the document uses a mixture of3.0.0
and3.1.0
features, causing validation failures.Detail
I cannot get OpenAI's latest OpenAPI spec to validate. I've had this for a while, but didn't dig into until today because I received a bug report on it. Specifically, this commit:
At the top of your OpenAPI spec, you have the following:
There are multiple errors when I attempt to load it. For example:
OpenAPI 3.0.x uses an extended subset of JSON Schema Draft 5 (which is just a cleanup of Draft 4), while version 3.1.x uses JSON Schema Draft 6. From the docs:
So for the
propertyNames
keyword referenced above, that was introduced in version JSON Schema Draft 6.Thus, you use
propertyNames
from OpenAPI v3.1.0, but declare that you're using OpenAPI v3.0.0, causing validation to fail.Unfortunately, switching from
openapi: 3.0.0
toopenapi: 3.1.0
may not be a quick fix. Again, from the changes between Draft 4 and Draft 6:So when we see things like this:
It should now be this:
Below is my full list of validation errors. I do not claim the list is fully correct because when I manually edit the spec to
openapi: 3.1.0
, my validation errors go away, despite some of the spec apparently being incorrect. I have not looked into this further.The text was updated successfully, but these errors were encountered: