-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Epic: Support OpenApi 3 #945
Comments
Is it possible to help you with this? I'm particularly interested in the new (or improved?) multipart support described in the spec, it'll allow adding API methods that take |
Hi @stijnherreman, yes, I'd really appreciate it! I think the first step is to find a way to enhance the model (NSwag.Core) so that both versions (2/3) can be serialized/deserialized from a single set of model classes (see updated issue). There are properties which have to be renamed or ignored depending on the spec version - for this we have a custom contract resolver (see https://blog.rsuter.com/advanced-newtonsoft-json-dynamically-rename-or-ignore-properties-without-changing-the-serialized-class/). I'm not sure yet, how we can maintain both versions in a single set of model classes (inheritance, only ignore/rename properties, property prefix?). I think we should start with the simpler thinks, like the new server specification (these are just new properties on SwaggerDocument, https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#serverObject). Then we can look into the new response handling, schema changes, etc... |
Most unit tests for the OpenApi 3 serialization are here: https://github.com/RSuter/NSwag/tree/master/src/NSwag.Core.Tests/Serialization If someone (@stijnherreman ?) wants to help, we need more unit tests, some OpenApi 3 properties are still missing, etc... The main idea is to add all properties from Swagger and OpenApi and then based on the target, ignore/hide or rename some properties. The Swagger properties which have an OpenApi equivalent should just be derived properties and update/read the OpenApi properties when being accessed... (see SwaggerDocument.Serialization.cs - there are also the renames/ignores) |
The specs can be found here: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md most properties of OpenApi are implemented, what currently is missing (and which are the hardest one to sync):
|
For proper inheritance support we also need:
|
Ref ea63ef2 |
Due to priority changes in our project I won't be able to spend time on this for now, unfortunately. Perhaps in a couple months, if help is still needed. |
@stijnherreman I then, I think help will also be needed in a couple of months :-) |
Some sample Swagger 2.0 and OpenAPI 3.0 specifications can be compared here: https://github.com/RSuter/NSwag/tree/master/src/NSwag.Sample.NETCore20/Output To update, just start the sample app and run |
PR to add explode and parameter style: #1342 |
I notice that this epic is still open and has some uncompleted tasks - is OAPI 3.0 fully supported in this library? |
Is this usable to upgrade to Open API 3 standard. |
Documentation in the wiki
Specification:
Changes:
Tasks:
bool? IsNullableRaw
to JsonSchema4 (default: false)Open questions:
The text was updated successfully, but these errors were encountered: