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 #2836

Merged
merged 98 commits into from
Mar 6, 2023
Merged

Provide support for OpenAPI 3.1.0 #2836

merged 98 commits into from
Mar 6, 2023

Conversation

char0n
Copy link
Member

@char0n char0n commented Feb 15, 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 30 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
Spec object can be provided instead of URL.
If baseDoc or url options are not provided,
default retrival URL is set to http://smartbear.com

Refs #2754
This change is specific to OpenAPI 3.1.0 resolution
strategy.

Refs #2754
This change is specific to OpenAPI 3.1.0 strategy.

Refs #2753
This change is specific to OpenAPI 3.1.0 strategy.

Refs #2748
char0n and others added 19 commits February 16, 2023 13:39
# [3.19.0-beta.2](v3.19.0-beta.1...v3.19.0-beta.2) (2023-02-16)

### Bug Fixes

* **install:** fix local dev setup for npm >= 8.19.3 ([6eee23d](6eee23d))
* **resolver:** use native error cause syntax with ApiDOM errors ([#2842](#2842)) ([ae0e7e8](ae0e7e8))

### Features

* **build:** limit the size of UMD build fragment as much as possible ([#2843](#2843)) ([982a858](982a858)), closes [#2837](#2837)
* **build:** limit the size on npm package as much as possible ([#2841](#2841)) ([a6c9f4f](a6c9f4f)), closes [#2837](#2837)
[email protected] comes with not correctly identified
sideEffects field in package.json.

[email protected] fixes this issue and allow bundlers
to bundle code properly again.
# [3.19.0-beta.3](v3.19.0-beta.2...v3.19.0-beta.3) (2023-02-21)

### Bug Fixes

* **build:** allow bundlers to process code properly ([#2852](#2852)) ([4eb131e](4eb131e))
Without this fix `npm ci` script in newer npm versions
has problem consolidating the dependency tree.
# [3.19.0-beta.4](v3.19.0-beta.3...v3.19.0-beta.4) (2023-02-22)

### Bug Fixes

* **build:** fix bundling of overridden ApiDOM deps ([#2853](#2853)) ([604cf87](604cf87))
* **build:** fix failing UMD build ([d8948ae](d8948ae))
# [3.19.0-beta.5](v3.19.0-beta.4...v3.19.0-beta.5) (2023-02-22)

### Bug Fixes

* **build:** remove @types/ramda from bundled dependencies ([783f1b1](783f1b1))
Part of this commit is consolidation of resolve
strategies and introduction of new 'strategies'
option for resolve and resolveSubTree functions.

The way this has been implemented allow effective
tree shaking.

Full API backward compatibility has remained.
# [3.19.0-beta.6](v3.19.0-beta.5...v3.19.0-beta.6) (2023-02-23)

### Features

* **resolver:** expose resolve strategies ([#2854](#2854)) ([2a39fb4](2a39fb4))
Resolve makers are functions that preconfigure
resolve and resolveSubTree function with default
options.
# [3.19.0-beta.7](v3.19.0-beta.6...v3.19.0-beta.7) (2023-02-24)

### Features

* **resolver:** expose resolve makers ([#2855](#2855)) ([5b88577](5b88577))
@char0n char0n marked this pull request as ready for review March 6, 2023 13:23
@char0n char0n merged commit 1adf82d into master Mar 6, 2023
@swagger-bot
Copy link
Contributor

🎉 This PR is included in version 3.19.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@char0n char0n deleted the beta branch September 7, 2023 12:18
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.

3 participants