Epic: Support OpenApi 3
See original GitHub issueSpecification:
- https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md
- https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md
Changes:
Tasks:
- Step 1: Support v2 and v3 models in NSwag.Core
- Implement all new contracts in the existing model classes (SwaggerDocument)
- Support null and oneOf => null is not supported but a new property “nullable” 😦
- Conditionally serialize either one of the two versions (i.e. ignore or rename properties)
- e.g. ToJson() with an additional enum parameter SchemaType (Swagger2 | OpenApi3)
- Support “nullable”: Add
bool? IsNullableRaw
to JsonSchema4 (default: false) - Support new discriminator format: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#discriminator-object
- Implement OpenApiMediaType.Encoding
- Step 2: Swagger generators
- Optionally generate Swagger 2.x or OpenAPI 3.x specs in the Swagger generators (Web API)
- Support new array parameters and properties: https://github.com/RSuter/NSwag/issues/1091
- Generate deepObject: https://github.com/RSuter/NSwag/issues/1594
- Step 3: Code generators
- Generate code based on the new models (should support both versions), i.e. only use OpenAPI 3 properties (which are set by the Swagger 2.0 properties) and do not use Swagger 2.0 properties anymore. Then support new OpenAPI 3.0 properties/features without breaking old and Swagger 2.0 features.
- Support wildcard http status codes: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#responses-object
Open questions:
- OpenApiRequestBody
- How to handle nullable body objects? Schema with nullable=true and allOf reference?
- SwaggerResponse
- How to handle nullable responses? With schema.nullable and allOf reference?
- Serialization
- Correctly support serializing to 2.0 or 3.0, see https://github.com/RSuter/NSwag/issues/1504
Issue Analytics
- State:
- Created 6 years ago
- Reactions:24
- Comments:15 (11 by maintainers)
Top Results From Across the Web
OpenAPI 3 support · RicoSuter/NSwag Wiki
The NSwag serializer supports Swagger 2.0 and OpenApi 3.0. This works by mapping all Swagger 2.0 properties to the OpenApi 3.0 properties.
Read more >Web Services
This web service allows third-party DMS vendors to launch activities within a pre-existing Hyperspace instance to link documents to records in Epic such...
Read more >OpenAPI Specification - Version 3.0.3
The OpenAPI Specification defines a standard interface to RESTful APIs which allows both humans and computers to understand service capabilities without ...
Read more >Interactive API documentation | GitLab
Introduces the interactive documentation tool for the GitLab API. About the OpenAPI specification. The OpenAPI specification (formerly called Swagger) defines a ...
Read more >FusionAuth OpenAPI Specification
This OpenAPI Specification allows you to use FusionAuth with OpenAPI tooling. It supports OpenAPI version 3. The OpenAPI specification project contains the yaml ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I guess a very small adjustment needs to be done to the open-api version number:
Currently it is only 3.0.
For proper inheritance support we also need: