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

Add OpenAPI 3.1 Support #795

Closed
11 tasks done
darrelmiller opened this issue Mar 15, 2022 · 22 comments
Closed
11 tasks done

Add OpenAPI 3.1 Support #795

darrelmiller opened this issue Mar 15, 2022 · 22 comments
Assignees
Labels
type:epic A large piece of work that has other tasks linked to it type:feature New experience request
Milestone

Comments

@felschr
Copy link

felschr commented May 3, 2022

I'm particularly interested in the new prefixItems option from the JSON schema specification, which can be used for supporting tuples as arrays:
https://stackoverflow.com/questions/57464633/how-to-define-a-json-array-with-concrete-item-definition-for-every-index-i-e-a

@gregsdennis
Copy link

gregsdennis commented Jun 24, 2022

@darrelmiller do you have an ETA on this? Do you need help?

@darrelmiller
Copy link
Member Author

It is currently planned as a stretch goal for CY2022H2.

@baywet
Copy link
Member

baywet commented Aug 23, 2022

I believe dictionary support is missing from the list microsoft/kiota#62

@KeithMAtFis
Copy link

One thing that i would like to see is support for readOnly on properties that are using $ref. for example
image

@gregsdennis
Copy link

@KeithMAtFis I have good news for you!

Previously, $ref meant that sibling keywords were ignored.

But since OpenAPI 3.1 uses JSON Schema 2020-12, this restriction is lifted, and now sibling keywords are respected.

Your use case should work as long as the package does something with the readonly annotation (I have no reason to believe it won't).

@KeithMAtFis
Copy link

KeithMAtFis commented Aug 31, 2022

@gregsdennis that is great. I should have provided some background, I am using Minimal API and DOTNet 6, C#10 and it seems that that does not support OpenAPI 3.1.0 yet in its current form. Out of the box there is Swagger support but it seems to only support 3.0.1 and backwards support to v2. I have not found a way to allow output to 3.1.0 standards.

The Nugets that I am using are Swashbuckle.AspNetCore, Swashbuckle.AspNetCore.Swagger and Swashbuckle.Core all at version 6.4.0 (latest). Would you know if there is another NuGet that I should be using or certain configuration i should use?

Btw, I really appreciate you taking the time to respond.

(here is the GITHUB link to support 3.1.0 in Swashbuckle domaindrivendev/Swashbuckle.AspNetCore#2349)

@gregsdennis
Copy link

gregsdennis commented Aug 31, 2022

I don't know of any others, no.

It looks like Swashbuckle is dependent upon this lib, so the goal is to get this one going first.

@gregsdennis
Copy link

There's a new project https://github.com/sourcemeta/alterschema that aims to convert between schema versions. I think they plan to handle OpenAPI versions as well eventually. This might take care of "Enable upcasting from V2/V3 to 3.1".

@mimse
Copy link

mimse commented Oct 27, 2022

What are the timeline on these changes? It looks like a lot of project depends on this project to move forward with OpenAPI 3.1

With regards,
Morten

@funkeyfreak
Copy link

Hello all! I'm taking a sab at implementing the 9th item - "Map nullable to null type." I have broken up this effort into two seperate PRs. I want to make sure I am not stepping on anyones toes before raising a PR.

The first modifies the parser to map the OpenAPI represetntation of null within a type array to the existing nullable property. The second implements the more complex type array support required by the OpenAPI specification.

Does this sound good to everyone?

@baywet
Copy link
Member

baywet commented Feb 13, 2023

Hey @funkeyfreak,
We're happy to merge any PR coming our way.
Make sure you start your work from release/2.0.0 and target that branch when opening your pull requests.
And let us know if you have questions.

@MaggieKimani1
Copy link
Contributor

@funkeyfreak we're considering taking a dependency on an external JSON schema library so maybe just hold off on creating a PR.

@TomBruns
Copy link

It looks a lot of progress is occurring to support this goal. Is there a general target on when OpenAPI v3.1 support will be released?

@zijianhuang
Copy link

Swagger/SmartBear has started to support 3.1 since June, at https://smartbear.com/news/news-releases/swagger-open-source-tooling-now-supports-latest-op/
And at the moment, the lib gives "Microsoft.OpenApi.Readers.Exceptions.OpenApiUnsupportedSpecVersionException : OpenAPI specification version '3.1.0' is not supported."

@msolujic
Copy link

hi all, do we have any update for this, any ETA, anything?

@MaggieKimani1
Copy link
Contributor

Hi @msolujic
This work is set out to go with our 2.0 release early next year. We're working on a couple of breaking changes hence the hold up.

@HavenDV
Copy link

HavenDV commented Nov 27, 2023

My research about OpenAPI 3.1 support led me to this project - https://github.com/gregsdennis/Graeae
Perhaps this will help someone right now, or will help with progress in this issue.

@gregsdennis
Copy link

@HavenDV I created that as kind of an experiment to see if I can make a JsonSchema.Net-based OpenAPI implementation.

It provides the models, and all of the referencing and everything works right, but it's really basic.

My focus is really the json-everything project that hosts the schema lib, and I don't really have time to put effort into Graeae right now.

@msolujic
Copy link

hi @MaggieKimani1
@zijianhuang @baywet

are we closer for this issue to be closed and OAS 3.1 to be supported by OpenAPI.NET?

@MaggieKimani1
Copy link
Contributor

Hi @msolujic, we've finished working on this issue but we're currently working on other breaking changes that need to go out with the v2.0 release. ETA for the preview release is within a month or less.

@varmancholan
Copy link

Do we have support for OAS 3.1 now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:epic A large piece of work that has other tasks linked to it type:feature New experience request
Projects
None yet
Development

No branches or pull requests