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 3.1.0 is coming #230

Open
danielgtaylor opened this issue Jun 19, 2020 · 35 comments
Open

OpenAPI 3.1.0 is coming #230

danielgtaylor opened this issue Jun 19, 2020 · 35 comments

Comments

@danielgtaylor
Copy link
Collaborator

danielgtaylor commented Jun 19, 2020

Maintainer EDIT: Want to see this move forward? Jump to this comment

First release candidate has been put up:

https://github.com/OAI/OpenAPI-Specification/releases/tag/3.1.0-rc0

Creating this issue to track what work needs to be done to support it. Of particular interest is the section on breaking changes to align with JSON Schema 2019-09.

@fenollp
Copy link
Collaborator

fenollp commented Jul 15, 2020

My opinion is it'd be best to bring in https://github.com/xeipuuv/gojsonschema and switch on OpenAPI's version field to know when to translate an OpenAPI <v3.1 schema to the JSON Schema format that this project handles.

@kevin-postman
Copy link

I see this issue was closed and help is wanted. Now that 3.1.0 is released, are there plans to soon start adding support for 3.1.0? Is there any discussion outside of Issues that I can participate in to get involved?

@fenollp
Copy link
Collaborator

fenollp commented Feb 18, 2021

Hi Kevin, this issue is still open although was not discussed outside of issues as far as I'm aware.
I think the way to support 3.1 as well as solve all the validation issues is through a func (s *openapi3.Swagger) CompileSchemas() error which would convert our schema data to gojsonschema's and for (*openapi3.Schema) VisitJSON*(...) error funcs to use that.
That'll break today's usage but this lib is v0 anyway.

@fenollp
Copy link
Collaborator

fenollp commented Feb 18, 2021

Actually gojsonschema only Supports draft-04, draft-06 and draft-07. today.
I'm not finding any lib that supports the 2020-12 draft that OpenAPIv3.1 relies on.
I do think that the move to this lib needs to happen though and support for new JSON Schema drafts will eventually land in gojsonschema AFAIK.

Do you have needs for the newer Schema Drafts or are you mostly interested in the other OpenAPIv3.1 changes?

@kevin-postman
Copy link

Me personally, interested in 3.1 support. Obviously the sooner tools support 3.1 the better and a lot of tools are built on top of kin-openapi. So I would think this is a pretty important update to add to kin-openapi as soon as possible. If moving to gojsonschema is the future anyway, then perhaps moving to it now along with adding 3.1 support should be taken up.
My apologies on thinking it was closed.. I see that was a linked issue. :D.

@wolfeidau
Copy link

@fenollp have you had a look at https://github.com/qri-io/jsonschema as a possible alternative given it currently states it supports 2019-09 and is supposedly faster?

@fenollp
Copy link
Collaborator

fenollp commented Mar 27, 2021

Yes and I did see the benchmark mentioning it was less correct than the other lib. See https://github.com/wbvinc/go-jsonschema-validator-benchmarks
I did not verify this on my end however.

I haven't dug in deeper yet but will in the coming weeks. Thanks for the link.

@timbunce
Copy link

Not only does https://github.com/qri-io/jsonschema support 2019-09, it's also actively maintained.

In contrast, gojsonschema had a last commit in Oct 2020 and last release in Oct 2019. Re supporting 2019-09 the author said in March 2020:

Plans yes, but time no. The new specification also requires a thorough rewrite of all the internals in order to support things like $vocabulary and unEvaluatedProperties and the like and I haven't found the courage yet to start that project in my spare time.

The santhosh-tekuri/jsonschema repo has no commits since Feb and no sign of working towards supporting 2019-09.

I think qri-io/jsonschema is the only horse in the race at the moment. Adopting it, and contributing fixes as needed, seems like the most fruitful path.

@kevin-postman
Copy link

If moving to qri-io/jsonschema moves kin-openapi to accepting openapi 3.1.0 sooner, I am all in favor. The sooner those of us using kin-openapi can start adding support for 3.1.0 the better. Seems like one of the nagging issues since the inception of Swagger/OpenAPI is how long it takes tools to adopt/migrate to a new version. Maybe reaching out to the qri-io team and having a dialog with them regarding their commitment might ease the idea of replacing the recent work with gojsonschema?

@timbunce
Copy link

The santhosh-tekuri/jsonschema repo has no commits since Feb and no sign of working towards supporting 2019-09.

santhosh-tekuri/jsonschema v4.0.0 says "draft 2019-09 support".

I think qri-io/jsonschema is the only horse in the race at the moment.

Seems like it's now a two horse race.

fenollp added a commit to fenollp/kin-openapi that referenced this issue Aug 26, 2021
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
@bojanz
Copy link

bojanz commented Sep 15, 2021

https://github.com/santhosh-tekuri/jsonschema now supports draft 2020-12, putting it ahead in the race.

@kevin-postman
Copy link

Is there any progress on 3.1 support? Wondering if anyone is working on it yet, or if not is there a plan to start work on it soon?

@fenollp
Copy link
Collaborator

fenollp commented Oct 8, 2021

I did some exploration in #412 but stumbled into roadblocks:

Issues should be raised on respective repos, I just didn't come around to doing that yet.

@kevin-postman
Copy link

Just following up to see if there is any movement on this issue? Any work in progress by anyone? Anytime soon maybe? 3.1 has been final for almost a year.. be good to see this project get a jump on it so Go projects depending upon it can start to support 3.1.

@fenollp
Copy link
Collaborator

fenollp commented Dec 29, 2021

Hi @kevin-postman and others,
I understand this issue (and some others) are pressing to some and would like to apologize for the less than stellar progress here.

I have been maintaining this project for a few years now and am looking to turn this into a more sustainable initiative.
Recently, I set up GitHub Sponsorship so if you'd like to support this project's future and preserve some of my mental health I encourage you to register for a monthly sponsoring here. A one-time donation can also help towards solving piecemeal issues.

Here's a tutorial from GitHub on how to find other maintainers that may need your help whose work you might depend on.

Regarding this specific issue, considering the large ramifications and attention to quality it entails, I would like to work on it once some funding has been promised or secured. We can discuss terms privately.

Licensing won't change due to sponsorship. All open source work will continue to be available to all and enjoyed equally by all members of the community.

TL;DR: Nothing changes and this continues being MIT licensed. Please consider Sponsoring.

@fenollp fenollp mentioned this issue Jan 5, 2022
@philsturgeon
Copy link

Hello! As the maintainer of openapi.tools, and as somebody works with Linux Foundation helping out in OpenAPI-land, I'm reaching out to tooling vendors to track the progress towards supporting OpenAPI v3.1, to see what roadblocks there are beyond folks just generally being busy at this ridiculous time.

OpenAPI v3.1 has a bunch of great little changes, solving problems like the JSON Schema <!=> OpenAPI Schema Object divergence. It also fixes some other inconsistencies and duplicate ways of doing things. It's the best version and everyone should be using it, but we need tooling to catch up. Just in case folks didn't notice, or don't have resources to simplify the process, I'm here to give a friendly prod and send over some handy links.

Here are a few articles showing off the differences between OpenAPI v3.0 and v3.1.

Here are some example files which can make for handy pass/fail test cases:

https://github.com/Mermade/openapi3-examples/tree/master/3.1

If you're looking for the JSON Schema that defines a valid OpenAPI document, that'll be right over here:

https://github.com/OAI/OpenAPI-Specification/tree/main/schemas/v3.1

Hopefully these links can help your contributors step up with confidence to help you get this project updated. If you do start getting pull requests towards OpenAPI 3.1 support, please send a pull request to openapi.tools with an issue tracking the progress, and folks will have a way to subscribe for updates.

LMK if you have any questions!

@santhosh-tekuri
Copy link

@fenollp you can easily compile schemas from openapi document using github.com/santhosh-tekuri/jsonschema/v5

here is the playground link that shows how to do it: https://go.dev/play/p/Hk077OKVi4e

@jamietanna
Copy link
Contributor

Just as a quick nudge on this - this appears to be blocking folks doing contract testing using one of the libraries I maintain that depends on this.

I may start looking into this at some point to see if we can start getting - even if it's just partial - support for OpenAPI 3.1

@petkostas
Copy link

petkostas commented Aug 16, 2022

Nice to see this moving forward, support for 3.1 is getting increasingly painful (at least in the GOlang world) as lots of tools rely on this library at the moment.
Let us know how we can contribute and get this moving forward.

@SVilgelm
Copy link
Contributor

I have played with the generics and created a small lib for openapi v3.1 https://github.com/sv-tools/openapi

Feel free to use it as an example

@philsturgeon
Copy link

philsturgeon commented Oct 19, 2022

This also seems like it might be handy. https://github.com/pb33f/libopenapi

@Ilyes512
Copy link

Any (progress) update on this subject? Not trying to put any pressure, but some more info might give us some insight going forward.

@jamietanna
Copy link
Contributor

jamietanna commented Apr 14, 2023

I've recently been chatting with @deepmap-marcinr around this with https://github.com/deepmap/oapi-codegen that we maintain.

I've looked at this a few times to start trying to pick up this, but have been a little overwhelmed by the amount of work it may lead to 😅 that may not be a fair assumption, but I've not got full appreciation of all the differences between versions.

@philsturgeon aside from the links above, do you have any reading / people that we may be able to chat to who've added support for 3.1 on top of 3.0?

I've planned to look through things like libopenapi ☝️ and others to see what sort of test data they've got that may give us an indication of how much needs to change in this library to support it.

I'm also considering seeing if folks fancy one-off sponsoring (not necessarily the $1000 option) work on this migration, as that may help with prioritising it.

@timbunce
Copy link

Bowtie is "a meta-validator for the JSON Schema specification" with test suites for multiple versions, including draft7, 2019-09, and 2020-12.

The results for draft7 include gojsonschema with 10 errors, and jsonschema with zero errors. The results for 2020-12 include only jsonschema with, again, zero errors.

@Ilyes512
Copy link

Is it important to keep supporting the older OpenApi implementations?

It might be easier to create a new version of this package (or a totally new one) that only starts supporting OpenApi from version 3.1, because you might be able to offload a larger part of the logic to an existing jsonschema package?

@deepmap-marcinr
Copy link

deepmap-marcinr commented Apr 24, 2023 via email

@jamietanna
Copy link
Contributor

@deepmap-marcinr I think you may be talking about oapi-codegen not kin-openapi? 😁

@deepmap-marcinr
Copy link

deepmap-marcinr commented Apr 24, 2023 via email

@podhmo
Copy link
Contributor

podhmo commented Jun 7, 2023

#230 (comment)

It might be easier to create a new version of this package (or a totally new one) that only starts supporting OpenApi from version 3.1, because you might be able to offload a larger part of the logic to an existing jsonschema package?

Indeed. As a smaller step, for example, creating an openapi31 directory and reimplementing everything might be a better flow?

As for creating new package, I honestly have mixed feelings about seemingly ignoring kin-openapi's excellent contributions.

@cletter7
Copy link

Is this being worked on or abandoned?

@excavador
Copy link

Any updates?

@Malix-Labs
Copy link

Seems like it's time to move to https://github.com/pb33f/libopenapi

@praneetloke
Copy link
Contributor

I think @fenollp is pretty clear that he would like some support from the community in terms of sponsorship to take on this task. See this comment from him. It would be nice to lend him the support he is looking for especially given the fact that this library is used in so many different packages in the Go ecosystem.

@martimors
Copy link

martimors commented Jun 11, 2024

Is it coming? 🤔

Edit: So many people here are users of Googles Apigee framework. I think it is unfortunate that this project gets a barrage of people complaining about OAS3.1 support missing, when this really should be a feature contributed by the Apigee maintainers for free, it's only fair given what they get out of this project for nothing. Just my opinion! At least let's not barrage the maintainers of FOSS software.

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

No branches or pull requests