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

Provide support for OpenAPI 3.1.0 #2786

Closed
wants to merge 69 commits into from
Closed

Provide support for OpenAPI 3.1.0 #2786

wants to merge 69 commits into from

Conversation

char0n
Copy link
Member

@char0n char0n commented Jan 23, 2023

The goal of this issue to introduce OpenAPI 3.1.0 support to the swagger-client. This support will come via ApiDOM integration.

stateDiagram-v2
    state "Swagger Client" as SwaggerClient
    state "HTTP Client" as SwaggerClientHTTPClient
    state "JSON Parser" as SwaggerClientJSONParser
    state "YALM 1.2 Parser" as SwaggerClientYALMParser
    
    state ApiDOM
    state "ApiDOM resolver plugin" as ApiDOMSwaggerClientResolverPlugin
    state "ApiDOM JSON parser plugin" as ApiDOMSwaggerClientJSONParserPlugin
    state "ApiDOM OpenAPI 3.1 JSON parser plugin" as ApiDOMSwaggerClientJSONOpenAPI31ParserPlugin
    state "ApiDOM YAML Parser plugin" as ApiDOMSwaggerClientYAMLParserlugin
    state "ApiDOM OpenAPI 3.1 YAML Parser plugin" as ApiDOMSwaggerClientYAMLOpenAPI31Parserlugin
    state "ApiDOM OpenAPI 3.1 normalization" as ApiDOMOpenAPI31Normalization
    state "ApiDOM OpenAPI 3.1 dereference strategy" as ApiDOMOpenAPI31DereferenceStrategy

    state "Meta patches" as ApiDOMOpenAPI31DereferenceStrategyMetaPatches
    state "Circular structures" as ApiDOMOpenAPI31DereferenceStrategyCircularStructures
    state "Parameter Macro" as ApiDOMOpenAPI31DereferenceStrategyParameterMacro
    state "Model Property Macro" as ApiDOMOpenAPI31DereferenceStrategyModelPropertyMacro
    state "Strict/Non-Strict mode (allOf)" as ApiDOMOpenAPI31DereferenceStrategyMode

    SwaggerClient --> SwaggerClientHTTPClient
    SwaggerClient --> SwaggerClientJSONParser
    SwaggerClient --> SwaggerClientYALMParser

    SwaggerClientHTTPClient --> ApiDOMSwaggerClientResolverPlugin
    SwaggerClientJSONParser --> ApiDOMSwaggerClientJSONParserPlugin
    SwaggerClientJSONParser --> ApiDOMSwaggerClientJSONOpenAPI31ParserPlugin
    SwaggerClientYALMParser --> ApiDOMSwaggerClientYAMLParserlugin
    SwaggerClientYALMParser --> ApiDOMSwaggerClientYAMLOpenAPI31Parserlugin

    ApiDOMOpenAPI31DereferenceStrategyMetaPatches --> ApiDOMOpenAPI31DereferenceStrategy
    ApiDOMOpenAPI31DereferenceStrategyCircularStructures --> ApiDOMOpenAPI31DereferenceStrategy
    ApiDOMOpenAPI31DereferenceStrategyParameterMacro --> ApiDOMOpenAPI31DereferenceStrategy
    ApiDOMOpenAPI31DereferenceStrategyModelPropertyMacro --> ApiDOMOpenAPI31DereferenceStrategy
    ApiDOMOpenAPI31DereferenceStrategyMode --> ApiDOMOpenAPI31DereferenceStrategy

    ApiDOM --> SwaggerClient
    ApiDOMOpenAPI31Normalization --> ApiDOM
    ApiDOMSwaggerClientResolverPlugin --> ApiDOM
    ApiDOMSwaggerClientJSONParserPlugin --> ApiDOM
    ApiDOMSwaggerClientJSONOpenAPI31ParserPlugin --> ApiDOM
    ApiDOMSwaggerClientYAMLParserlugin --> ApiDOM
    ApiDOMSwaggerClientYAMLOpenAPI31Parserlugin --> ApiDOM
    ApiDOMOpenAPI31DereferenceStrategy --> ApiDOM
Loading

TODO:


Refs #2718
Refs #2717


Prereleases of this PR are being published via [email protected] channel.

char0n added 25 commits January 23, 2023 18:16
This will allow to use optional chaining and other
JavaScript advanced features.

Refs #2717
Node.js =12.20.0 added support for exports field.
Node.js =12.19.0 added support for imports field.

Both of these fields are used by integrated ApiDOM.

[email protected] doesn't yet support package.json imports
field. Next version will, more info in:
jestjs/jest#12270.

Refs #2744
LinkElement visit hook works on top of ApiDOM only,
and has no effect when serialized into POJO.
This commit disables this visit hook.

LinkElement is a runtime things, we're not making
the LinkElement.operationRef absolute as during the runtime
relative references might resolve against different
URIs then in parsing/dereference phase.

Refs #2793
This change in specific to OpenAPI 3.1.0 resolution
strategy. Errors are now collected, instead of
thrown and visitor tranversal is not interrupted.

Refs #2798
char0n and others added 11 commits January 31, 2023 11:33
This change is specific to OpenAPI 3.1.0 resolution
strategy. Errors are now collected, instead of
thrown and visitor traversal is not interrupted.

Refs #2802
This change is specific to OpenAPI 3.1.0 resolution
strategy. Errors are now collected, instead of
thrown and visitor traversal is not interrupted.

Refs #2804
This change is specific to OpenAPI 3.1.0 resolution
strategy. Errors are now collected, instead of
thrown and visitor traversal is not interrupted.

Refs #2806
This change is specific to OpenAPI 3.1.0 resolution
strategy. Errors are now collected, instead of
thrown and visitor traversal is not interrupted.

Refs #2808
…2811)

This change is specific to OpenAPI 3.1.0 resolution
strategy. Errors are now collected, instead of
thrown and visitor traversal is not interrupted.

Refs #2810
…#2813)

This change in specific to OpenAPI 3.1.0 resolution
strategy. Errors are now collected, instead of
thrown and visitor traversal is not interrupted.

Refs #2812
# [3.19.0-alpha.4](v3.19.0-alpha.3...v3.19.0-alpha.4) (2023-02-01)

### Bug Fixes

* **resolver:** remove LinkElement hook main dereference ([ef9d20d](ef9d20d)), closes [#2793](#2793)

### Features

* **resolver:** collect errors in AllOfVisitor hooks ([#2809](#2809)) ([627ee8d](627ee8d)), closes [#2808](#2808)
* **resolver:** collect errors in ExampleElement visitor hook ([09872a5](09872a5)), closes [#2798](#2798)
* **resolver:** collect errors in ModelPropertyMacro visitor hooks ([#2811](#2811)) ([6cef9ff](6cef9ff)), closes [#2810](#2810)
* **resolver:** collect errors in ParameterMacroVisitor visitor hooks ([#2813](#2813)) ([29ea34d](29ea34d)), closes [#2812](#2812)
* **resolver:** collect errors in PathItemElement visitor hook ([#2805](#2805)) ([fba4bbc](fba4bbc)), closes [#2804](#2804)
* **resolver:** collect errors in ReferenceElement visitor hook ([#2803](#2803)) ([3983953](3983953)), closes [#2802](#2802)
* **resolver:** collect errors in SchemaElement visitor hook ([#2807](#2807)) ([a098d85](a098d85)), closes [#2806](#2806)
* **resolver:** create ApiDOM path -> SwaggerClient path translator ([280f301](280f301)), closes [#2794](#2794)
@char0n
Copy link
Member Author

char0n commented Feb 15, 2023

WARNING

This PR has been superseded by #2836

@char0n char0n closed this Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants