[Not working] Try upgrading to OAPIv3.1 #653
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is not a real PR, but I did some work to see what would be needed to upgrade to Open API v3.1 and don't want it to be lost to time.
As far as I can tell, the AJV/OpenAPIv3.1 combo doesn't seem to be correctly working right now, as I eventually realized I can't even get the OpenAPI example to validate with AJV. This is the issue I filed on the AJV repo: ajv-validator/ajv#1745
Other things I've learned:
ajv-draft-04
is needed to maintain compatibility with what's already being validated by this package, or potentially https://github.com/ajv-validator/json-schema-migrate.The file I've dedicated most of my attention to is
src/framework/openapi.schema.validator.ts
. You can see here the options I've passed to AJV, which are also attached to the issue filed. An explanation for those can be found here: OAI/OpenAPI-Specification#2489I'll see how the discussion with the AJV folks goes (and then with the OpenAPI folks as needed), but it's unknown whether I'll pick this back up. Hopefully, however, this initial investigation is useful for someone.
Sorry for the mess in these files! I tried a lot of different things.