Skip to content
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

OpenAPI v3.1 #471

Closed
philsturgeon opened this issue Jan 5, 2022 · 2 comments
Closed

OpenAPI v3.1 #471

philsturgeon opened this issue Jan 5, 2022 · 2 comments

Comments

@philsturgeon
Copy link

Hello there! Thanks for this brilliant tool, it was such a shame to see the go community stuck with OpenAPI v2.0 for so long, but you've rescued everyone nicely.

OpenAPI v3.1 is out, and thankfully it's not as much of a change as v2>v3 was. It finally converges with JSON Schema, so it's entirely compatible (just a few extra keywords like discriminator which do not change the meaning of the OpenAPI document at all).

Here are the changes: https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0

Normally I'd say upgrading isn't so hard, because you can grab any old JSON Schema tooling and use that, but the Go JSON Schema tooling is a little out of date: https://json-schema.org/implementations.html#validator-go

This might be a good oppertunity to abstract the v3.0 schema logic into its own code, then tweak it a little to be true JSON Schema Draft 2020-12, release that part as a pure JSON Schema module, then you can deprecate the v3.0 logic in the future. Then JSON Schema has some new validation logic, and you're up to date with a slightly smaller package.

Alternatively you could reach out to the maintainers of those Go JSON Schema packages and see if any of them could be updated easily. Many are driver based so perhaps you could send your tweaked v3.0 logic over to them as Draft 2020-12 support!

@fenollp
Copy link
Collaborator

fenollp commented Jan 5, 2022

Hi! Thanks for the kind words and notes.
Closing this as a dupe of #230

@fenollp fenollp closed this as completed Jan 5, 2022
@philsturgeon
Copy link
Author

Cheers. I've given this a shoutout. https://twitter.com/apisyouwonthate/status/1478770356152414209

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants