Skip to content

Commit 1adf82d

Browse files
authored
Merge pull request #2836 from the beta branch
Provide support for OpenAPI 3.1.0
2 parents c500759 + 8155586 commit 1adf82d

File tree

485 files changed

+38313
-5647
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

485 files changed

+38313
-5647
lines changed

Diff for: .eslintrc

+17-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
},
88
"globals": {
99
"File": true,
10-
"Blob": true
10+
"Blob": true,
11+
"globalThis": true
1112
},
1213
"parserOptions": {
1314
"sourceType": "module",
15+
"ecmaVersion": 2020,
1416
"ecmaFeatures": {
1517
"impliedStrict": true
1618
}
@@ -32,6 +34,20 @@
3234
"ignorePackages": true
3335
}
3436
],
37+
"import/no-unresolved": [
38+
2,
39+
{
40+
"ignore": [
41+
"^@swagger-api/apidom-reference/configuration/empty$",
42+
"^@swagger-api/apidom-reference/dereference/strategies/openapi-3-1$",
43+
"^@swagger-api/apidom-reference/dereference/strategies/openapi-3-1/selectors/\\$anchor$",
44+
"^@swagger-api/apidom-reference/dereference/strategies/openapi-3-1/selectors/uri$",
45+
"^@swagger-api/apidom-reference/resolve/resolvers/file$",
46+
"^@swagger-api/apidom-reference/resolve/strategies/openapi-3-1$",
47+
"^@swagger-api/apidom-reference/parse/parsers/binary$"
48+
]
49+
}
50+
],
3551
"prettier/prettier": "error",
3652
"no-param-reassign": 0, // needs to be eliminated in future
3753
"no-use-before-define": [2, "nofunc"] // needs to be eliminated in future

Diff for: .github/workflows/nodejs.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,17 @@ jobs:
5757

5858
steps:
5959
- uses: actions/checkout@v3
60-
- name: Use Node.js 12.4.x
60+
- name: Use Node.js 12.20.0
6161
uses: actions/setup-node@v3
6262
with:
63-
node-version: 12.4.x
63+
node-version: 12.20.0
6464
- name: Cache Node Modules
6565
id: cache-node-modules
6666
uses: actions/cache@v3
6767
with:
6868
path: node_modules
6969
key: node-modules-${{ hashFiles('package-lock.json') }}
70+
7071
- name: Install dependencies
7172
if: steps.cache-node-modules.outputs.cache-hit != 'true'
7273
run: npm ci
@@ -76,19 +77,21 @@ jobs:
7677
with:
7778
name: commonjs
7879

79-
- name: Run commonjs build artifacts on Node.js 12.4.x
80+
- name: Run commonjs build artifacts on Node.js 12.20.0
8081
run: node -p "require('./commonjs')"
8182

8283
- name: Use Node 14.x
8384
uses: actions/setup-node@v3
8485
with:
8586
node-version: 14.x
87+
8688
- name: Run commonjs build artifacts on Node.js 14.x
8789
run: node -p "require('./commonjs')"
8890

8991
- name: Use Node 16.x
9092
uses: actions/setup-node@v3
9193
with:
9294
node-version: 16.x
95+
9396
- name: Run commonjs build artifacts on Node.js 16.x
9497
run: node -p "require('./commonjs')"

Diff for: .github/workflows/release.yml

-9
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@ name: Release
22
on:
33
workflow_dispatch:
44
branches:
5-
- alpha
65
- beta
76

8-
workflow_run:
9-
workflows:
10-
- "Node.js CI"
11-
branches:
12-
- master
13-
types:
14-
- completed
157
jobs:
168
release:
179
name: Release
1810
runs-on: ubuntu-latest
19-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2011
steps:
2112
- name: Checkout
2213
uses: actions/checkout@v3

Diff for: .nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.17
1+
16.16

Diff for: .releaserc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"release": {
33
"branches": [
4-
{"name": "master"}
4+
{"name": "master"},
5+
{"name": "beta", "channel": "beta", "prerelease": "beta"}
56
],
67
"tagFormat": "v${version}"
78
},

Diff for: README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,17 @@ For features known to be missing from 3.x please see the [Graveyard](docs/migrat
1616
For the older version of swagger-js, refer to the [*2.x branch*](https://github.com/swagger-api/swagger-js/tree/2.x).
1717

1818
> *The npm package is called `swagger-client` and the GitHub repository is `swagger-js`.
19-
We'll be consolidating that soon. Just giving you the heads up. You may see references to both names.*
19+
We'll be consolidating that soon. Just giving you the heads-up. You may see references to both names.*
2020

2121
## Compatibility
2222
The OpenAPI Specification has undergone multiple revisions since initial creation in 2010.
2323
Compatibility between Swagger Client and the OpenAPI Specification is as follows:
2424

25-
Swagger Client Version | Release Date | OpenAPI Spec compatibility | Notes
26-
------------------ | ------------ | -------------------------- | -----
27-
3.10.x | 2020-01-17 | 2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3 | [tag v3.10.0](https://github.com/swagger-api/swagger-js/tree/v3.10.0)
28-
2.1.32 | 2017-01-12 | 1.0, 1.1, 1.2 | [tag v2.1.32](https://github.com/swagger-api/swagger-js/tree/v2.1.32). This [release](https://github.com/swagger-api/swagger-js/releases/tag/v2.1.32) is only available on GitHub.
25+
Swagger Client Version | Release Date | OpenAPI Spec compatibility | Notes
26+
------------------ |--------------|----------------------------------------| -----
27+
3.19.x | 2023-01-23 | 2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.1.0 | [tag v3.19.0-alpha.3](https://github.com/swagger-api/swagger-js/releases/tag/v3.19.0-alpha.3)
28+
3.10.x | 2020-01-17 | 2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3 | [tag v3.10.0](https://github.com/swagger-api/swagger-js/tree/v3.10.0)
29+
2.1.32 | 2017-01-12 | 1.0, 1.1, 1.2 | [tag v2.1.32](https://github.com/swagger-api/swagger-js/tree/v2.1.32). This [release](https://github.com/swagger-api/swagger-js/releases/tag/v2.1.32) is only available on GitHub.
2930

3031
## Documentation
3132

@@ -51,7 +52,7 @@ Swagger Client Version | Release Date | OpenAPI Spec compatibility | Notes
5152

5253
### Runtime
5354

54-
- Node.js `>=` 12.4.x
55+
- Node.js `>=`12.20.0
5556
- `swagger-client` works in the latest versions of Chrome, Safari, Firefox, and Edge.
5657

5758
## Security contact

Diff for: babel.config.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/**
2+
* This is override for https://github.com/lodash/babel-plugin-lodash/issues/259.
3+
* babel-plugin-lodash is using deprecated babel API, which causes generation of many
4+
* console.trace calls.
5+
*/
6+
7+
const consoleTrace = console.trace.bind(console);
8+
console.trace = (message, ...optionalParams) => {
9+
if (
10+
typeof message === 'string' &&
11+
message.startsWith('`isModuleDeclaration` has been deprecated')
12+
) {
13+
return undefined; // noop
14+
}
15+
16+
return consoleTrace(message, ...optionalParams);
17+
};
18+
119
module.exports = {
220
env: {
321
commonjs: {
@@ -10,7 +28,7 @@ module.exports = {
1028
corejs: { version: 3 },
1129
useBuiltIns: false,
1230
targets: {
13-
node: '12.4',
31+
node: '12.20.0',
1432
},
1533
forceAllTransforms: false,
1634
ignoreBrowserslistConfig: true,

Diff for: config/jest/jest.artifact-commonjs.config.js

+16
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,20 @@ module.exports = {
44
rootDir: path.join(__dirname, '..', '..'),
55
testEnvironment: 'node',
66
testMatch: ['**/test/build-artifacts/commonjs.js'],
7+
moduleNameMapper: {
8+
/**
9+
* This is here only until next version of Jest is released - 29.4.x.
10+
* Jest doesn't support package.json imports fields now, so we have
11+
* to provide this workaround.
12+
*
13+
* More information in https://github.com/facebook/jest/issues/12270.
14+
*
15+
*/
16+
'#buffer':
17+
'<rootDir>/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/buffer/protocol-import.cjs',
18+
'#fs':
19+
'<rootDir>/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/fs/protocol-import.cjs',
20+
'#util':
21+
'<rootDir>/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/util/protocol-import.cjs',
22+
},
723
};

Diff for: config/jest/jest.artifact-es.config.js

+16
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,20 @@ module.exports = {
44
rootDir: path.join(__dirname, '..', '..'),
55
testEnvironment: 'node',
66
testMatch: ['**/test/build-artifacts/es.js'],
7+
moduleNameMapper: {
8+
/**
9+
* This is here only until next version of Jest is released - 29.4.x.
10+
* Jest doesn't support package.json imports fields now, so we have
11+
* to provide this workaround.
12+
*
13+
* More information in https://github.com/facebook/jest/issues/12270.
14+
*
15+
*/
16+
'#buffer':
17+
'<rootDir>/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/buffer/protocol-import.cjs',
18+
'#fs':
19+
'<rootDir>/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/fs/protocol-import.cjs',
20+
'#util':
21+
'<rootDir>/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/util/protocol-import.cjs',
22+
},
723
};

Diff for: config/jest/jest.unit.config.js

+16
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,28 @@ module.exports = {
88
moduleNameMapper: {
99
'formdata-node/lib/cjs/fileFromPath.js':
1010
'<rootDir>/node_modules/formdata-node/lib/cjs/fileFromPath.js',
11+
/**
12+
* This is here only until next version of Jest is released - 29.4.x.
13+
* Jest doesn't support package.json imports fields now, so we have
14+
* to provide this workaround.
15+
*
16+
* More information in https://github.com/facebook/jest/issues/12270.
17+
*
18+
*/
19+
'#buffer':
20+
'<rootDir>/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/buffer/protocol-import.cjs',
21+
'#fs':
22+
'<rootDir>/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/fs/protocol-import.cjs',
23+
'#util':
24+
'<rootDir>/node_modules/@swagger-api/apidom-reference/cjs/util/polyfills/util/protocol-import.cjs',
1125
},
1226
testPathIgnorePatterns: [
1327
'<rootDir>/node_modules/',
1428
'<rootDir>/test/data/',
1529
'<rootDir>/test/jest.setup.js',
1630
'<rootDir>/test/specmap/data/',
1731
'<rootDir>/test/build-artifacts/',
32+
'/__fixtures__/',
33+
'/__utils__/',
1834
],
1935
};

Diff for: config/jest/jest.unit.coverage.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
const unitConfig = require('./jest.unit.config');
1+
const unitConfig = require('./jest.unit.config.js');
22

33
module.exports = {
44
...unitConfig,
55
collectCoverage: true,
66
collectCoverageFrom: ['src/**/*.js'],
77
coverageThreshold: {
88
'./src/': {
9-
branches: 87,
9+
branches: 86,
1010
functions: 91,
1111
lines: 90,
12-
statements: 90,
12+
statements: 89,
1313
},
1414
},
1515
};

Diff for: config/webpack/browser.config.babel.js

+7-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import path from 'path';
2-
import webpack from 'webpack';
32
import { StatsWriterPlugin } from 'webpack-stats-plugin';
43
import { DuplicatesPlugin } from 'inspectpack/plugin';
54
import { WebpackBundleSizeAnalyzerPlugin } from 'webpack-bundle-size-analyzer';
@@ -45,20 +44,12 @@ const browser = {
4544
module,
4645
plugins: [
4746
new LodashModuleReplacementPlugin(),
48-
new webpack.LoaderOptionsPlugin({
49-
minimize: true,
50-
}),
5147
new DuplicatesPlugin({
5248
// emit compilation warning or error? (Default: `false`)
53-
emitErrors: true,
49+
emitErrors: false, // https://github.com/FormidableLabs/inspectpack/issues/181
5450
// display full duplicates information? (Default: `false`)
5551
verbose: true,
5652
}),
57-
new WebpackBundleSizeAnalyzerPlugin('swagger-client.browser-sizes.txt'),
58-
new StatsWriterPlugin({
59-
filename: path.join('swagger-client.browser-stats.json'),
60-
fields: null,
61-
}),
6253
],
6354
optimization: {
6455
minimize: false,
@@ -74,8 +65,8 @@ const browserMin = {
7465
devtool: 'source-map',
7566
performance: {
7667
hints: 'error',
77-
maxEntrypointSize: 270000,
78-
maxAssetSize: 1300000,
68+
maxEntrypointSize: 440000,
69+
maxAssetSize: 50000000,
7970
},
8071
output: {
8172
path: path.resolve('./dist'),
@@ -95,8 +86,10 @@ const browserMin = {
9586
module,
9687
plugins: [
9788
new LodashModuleReplacementPlugin(),
98-
new webpack.LoaderOptionsPlugin({
99-
minimize: true,
89+
new WebpackBundleSizeAnalyzerPlugin('swagger-client.browser-sizes.txt'),
90+
new StatsWriterPlugin({
91+
filename: path.join('swagger-client.browser-stats.json'),
92+
fields: null,
10093
}),
10194
],
10295
optimization: {

Diff for: docs/development/scripts.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Script name | Description
1313
--- | ---
1414
`build` | Build a new set of JS assets, and output them to `/dist` and `/browser`.
1515
`build:umd:browser` | Build `/dist/swagger-client.browser.*.js` files.
16-
`build:common` | Build `/lib` directory containing ES5 code with commonjs imports.
16+
`build:commonjs` | Build `/lib` directory containing ES5 code with commonjs imports.
1717
`build:es` | Build `/es` directory containing ES5 code with ES6 imports
1818

1919
### Testing
@@ -31,8 +31,5 @@ Script name | Description
3131

3232
Script name | Description
3333
--- | ---
34-
`security-audit` | Runs npm security audit for production and development dependencies.
35-
`security-audit:dev` | Runs npm security audit for all development dependencies with `moderate` audit level.
36-
`security-audit:prod` | Runs npm security audit for production dependencies with `low` audit level.
3734
`deps:license` | Generates attribution files for production and development dependencies
3835

Diff for: docs/development/setting-up.md

+8-11
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,20 @@
33
### Prerequisites
44

55
- git, any version
6-
- NPM >=6.12.x
6+
- Node.js >=16.16
7+
- NPM >=8.11.0
78

89
Generally, we recommend following guidelines from [Node.js Releases](https://nodejs.org/en/about/releases/) to only use `Current`, `Active LTS` or `Maintenance LTS` releases.
910

10-
Current Node.js:
11-
- Node.js 16.x
12-
- NPM >=7.10.x
11+
### Setting up
1312

14-
Current Node.js Active LTS:
15-
- Node.js >=14.x
16-
- NPM >=6.14.x
13+
If you use [nvm](https://github.com/nvm-sh/nvm), running following command inside this repository will automatically pick the right Node.js version for you:
1714

18-
Current Node.js Maintenance LTS:
19-
- Node.js >12.4
20-
- NPM >=6.12.x
15+
```sh
16+
$ nvm use
17+
```
2118

22-
### Steps
19+
#### Setup teps
2320

2421
1. `git clone https://github.com/swagger-api/swagger-js.git`
2522
2. `cd swagger-js`

0 commit comments

Comments
 (0)