swagger-client 3.38.0 → 3.38.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NOTICE CHANGED
@@ -1,2 +1,2 @@
1
- swagger-js/swagger-client
1
+ swagger-client
2
2
  Copyright 2020-2021 SmartBear Software Inc.
package/README.md CHANGED
@@ -1,22 +1,19 @@
1
1
  # Swagger Client <img src="https://raw.githubusercontent.com/swagger-api/swagger.io/wordpress/images/assets/SW-logo-clr.png" height="50" align="right">
2
2
 
3
- [![Build Status](https://github.com/swagger-api/swagger-js/actions/workflows/nodejs.yml/badge.svg)](https://github.com/swagger-api/swagger-js/actions)
3
+ [![Build Status](https://github.com/swagger-api/swagger-client/actions/workflows/nodejs.yml/badge.svg)](https://github.com/swagger-api/swagger-client/actions)
4
4
 
5
5
  **Swagger Client** is a JavaScript module that allows you to fetch, resolve, and interact with Swagger/OpenAPI documents.
6
6
 
7
7
  ## New!
8
8
 
9
- **This is the new version of swagger-js, 3.x.** The new version supports Swagger 2.0 as well as OpenAPI 3.
9
+ **This is the new version of Swagger Client, 3.x.** The new version supports Swagger 2.0 as well as OpenAPI 3.
10
10
 
11
11
  Want to learn more? Check out our [FAQ](docs/migration/migration-2-x-to-3-x.md).
12
12
 
13
13
  For features known to be missing from 3.x please see the [Graveyard](docs/migration/graveyard-3-x.md).
14
14
 
15
15
 
16
- For the older version of swagger-js, refer to the [*2.x branch*](https://github.com/swagger-api/swagger-js/tree/2.x).
17
-
18
- > *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.*
16
+ For the older version of Swagger Client, refer to the [*2.x branch*](https://github.com/swagger-api/swagger-client/tree/2.x).
20
17
 
21
18
  ## Compatibility
22
19
  The OpenAPI Specification has undergone multiple revisions since initial creation in 2010.
@@ -24,11 +21,11 @@ Compatibility between Swagger Client and the OpenAPI Specification is as follows
24
21
 
25
22
  Swagger Client Version | Release Date | OpenAPI Spec compatibility | Notes
26
23
  ------------------ |--------------|---------------------------------------------------------| -----
27
- 3.37.x | 2026-02-27 | 2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.1.0, 3.2.0 | [tag v3.37.0](https://github.com/swagger-api/swagger-js/releases/tag/v3.37.0)
28
- 3.33.x | 2024-12-30 | 2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.1.0 | [tag v3.33.0](https://github.com/swagger-api/swagger-js/releases/tag/v3.33.0)
29
- 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)
30
- 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)
31
- 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.
24
+ 3.37.x | 2026-02-27 | 2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.1.0, 3.2.0 | [tag v3.37.0](https://github.com/swagger-api/swagger-client/releases/tag/v3.37.0)
25
+ 3.33.x | 2024-12-30 | 2.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.1.0 | [tag v3.33.0](https://github.com/swagger-api/swagger-client/releases/tag/v3.33.0)
26
+ 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-client/releases/tag/v3.19.0-alpha.3)
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-client/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-client/tree/v2.1.32). This [release](https://github.com/swagger-api/swagger-client/releases/tag/v2.1.32) is only available on GitHub.
32
29
 
33
30
  ## Anonymized analytics
34
31
 
@@ -2272,7 +2272,7 @@ const self = {
2272
2272
  };
2273
2273
 
2274
2274
  // Make an execute, bound to arguments defined in mapTagOperation's callback (cb)
2275
- function makeExecute(swaggerJs = {}) {
2275
+ function makeExecute(swaggerClient = {}) {
2276
2276
  return ({
2277
2277
  pathName,
2278
2278
  method,
@@ -2282,9 +2282,9 @@ function makeExecute(swaggerJs = {}) {
2282
2282
  requestInterceptor,
2283
2283
  responseInterceptor,
2284
2284
  userFetch
2285
- } = swaggerJs;
2286
- return swaggerJs.execute({
2287
- spec: swaggerJs.spec,
2285
+ } = swaggerClient;
2286
+ return swaggerClient.execute({
2287
+ spec: swaggerClient.spec,
2288
2288
  requestInterceptor,
2289
2289
  responseInterceptor,
2290
2290
  userFetch,
@@ -2301,12 +2301,12 @@ function makeExecute(swaggerJs = {}) {
2301
2301
  // The shape
2302
2302
  // { apis: { [tag]: { operations: [operation]: { execute }}}}
2303
2303
  // NOTE: this is mostly for compatibility
2304
- function makeApisTagOperationsOperationExecute(swaggerJs = {}) {
2304
+ function makeApisTagOperationsOperationExecute(swaggerClient = {}) {
2305
2305
  // { apis: tag: operations: execute }
2306
- const cb = self.makeExecute(swaggerJs);
2306
+ const cb = self.makeExecute(swaggerClient);
2307
2307
  const tagOperations = self.mapTagOperations({
2308
- v2OperationIdCompatibilityMode: swaggerJs.v2OperationIdCompatibilityMode,
2309
- spec: swaggerJs.spec,
2308
+ v2OperationIdCompatibilityMode: swaggerClient.v2OperationIdCompatibilityMode,
2309
+ spec: swaggerClient.spec,
2310
2310
  cb
2311
2311
  });
2312
2312
  const apis = {};
@@ -2328,12 +2328,12 @@ function makeApisTagOperationsOperationExecute(swaggerJs = {}) {
2328
2328
  }
2329
2329
 
2330
2330
  // .apis[tag][operationId]:ExecuteFunction interface
2331
- function makeApisTagOperation(swaggerJs = {}) {
2332
- const cb = self.makeExecute(swaggerJs);
2331
+ function makeApisTagOperation(swaggerClient = {}) {
2332
+ const cb = self.makeExecute(swaggerClient);
2333
2333
  return {
2334
2334
  apis: self.mapTagOperations({
2335
- v2OperationIdCompatibilityMode: swaggerJs.v2OperationIdCompatibilityMode,
2336
- spec: swaggerJs.spec,
2335
+ v2OperationIdCompatibilityMode: swaggerClient.v2OperationIdCompatibilityMode,
2336
+ spec: swaggerClient.spec,
2337
2337
  cb
2338
2338
  })
2339
2339
  };
@@ -34316,7 +34316,7 @@ class Schema extends _swagger_api_apidom_ns_json_schema_2020_12__WEBPACK_IMPORTE
34316
34316
  /**
34317
34317
  * OAS base vocabulary
34318
34318
  *
34319
- * URI: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#baseVocabulary
34319
+ * URI: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#base-vocabulary
34320
34320
  */
34321
34321
 
34322
34322
  get discriminator() {
@@ -34542,7 +34542,7 @@ class OpenAPIMediaTypes extends _swagger_api_apidom_core__WEBPACK_IMPORTED_MODUL
34542
34542
  const effectiveFormat = format === 'generic' ? 'openapi;version' : format;
34543
34543
  return this.filter(mediaType => mediaType.includes(effectiveFormat));
34544
34544
  }
34545
- findBy(version = '3.1.0', format = 'generic') {
34545
+ findBy(version = '3.1.2', format = 'generic') {
34546
34546
  const search = format === 'generic' ? `vnd.oai.openapi;version=${version}` : `vnd.oai.openapi+${format};version=${version}`;
34547
34547
  const found = this.find(mediaType => mediaType.includes(search));
34548
34548
  return found || this.unknownMediaType;
@@ -34555,7 +34555,7 @@ class OpenAPIMediaTypes extends _swagger_api_apidom_core__WEBPACK_IMPORTED_MODUL
34555
34555
  /**
34556
34556
  * @public
34557
34557
  */
34558
- const mediaTypes = new OpenAPIMediaTypes('application/vnd.oai.openapi;version=3.1.0', 'application/vnd.oai.openapi+json;version=3.1.0', 'application/vnd.oai.openapi+yaml;version=3.1.0');
34558
+ const mediaTypes = new OpenAPIMediaTypes('application/vnd.oai.openapi;version=3.1.0', 'application/vnd.oai.openapi+json;version=3.1.0', 'application/vnd.oai.openapi+yaml;version=3.1.0', 'application/vnd.oai.openapi;version=3.1.1', 'application/vnd.oai.openapi+json;version=3.1.1', 'application/vnd.oai.openapi+yaml;version=3.1.1', 'application/vnd.oai.openapi;version=3.1.2', 'application/vnd.oai.openapi+json;version=3.1.2', 'application/vnd.oai.openapi+yaml;version=3.1.2');
34559
34559
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mediaTypes);
34560
34560
 
34561
34561
  /***/ },
@@ -35655,7 +35655,7 @@ const plugin = ({
35655
35655
  /**
35656
35656
  * Establishes identity between two Parameter Objects.
35657
35657
  *
35658
- * {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#user-content-operationparameters}
35658
+ * {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.2.md#operation-parameters}
35659
35659
  */
35660
35660
  const parameterEquals = (parameter1, parameter2) => {
35661
35661
  if (!predicates.isParameterElement(parameter1)) return false;
@@ -40194,7 +40194,7 @@ const plugin = ({
40194
40194
  /**
40195
40195
  * Establishes identity between two Parameter Objects.
40196
40196
  *
40197
- * {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#user-content-operationparameters}
40197
+ * {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.2.0.md#operation-parameters}
40198
40198
  */
40199
40199
  const parameterEquals = (parameter1, parameter2) => {
40200
40200
  if (!predicates.isParameterElement(parameter1)) return false;
@@ -54924,16 +54924,21 @@ function requireLoader() {
54924
54924
  state.result += _result;
54925
54925
  }
54926
54926
  }
54927
+ function chargeMergeWork(state) {
54928
+ state.totalMergeKeys++;
54929
+ if (state.maxTotalMergeKeys !== -1 && state.totalMergeKeys > state.maxTotalMergeKeys) {
54930
+ throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
54931
+ }
54932
+ }
54927
54933
  function mergeMappings(state, destination, source, overridableKeys) {
54928
54934
  if (!common2.isObject(source)) {
54929
54935
  throwError(state, "cannot merge mappings; the provided source object is unacceptable");
54930
54936
  }
54937
+ chargeMergeWork(state);
54931
54938
  const sourceKeys = Object.keys(source);
54932
54939
  for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
54933
54940
  const key = sourceKeys[index];
54934
- if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {
54935
- throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
54936
- }
54941
+ chargeMergeWork(state);
54937
54942
  if (!_hasOwnProperty.call(destination, key)) {
54938
54943
  setProperty(destination, key, source[key]);
54939
54944
  overridableKeys[key] = true;
@@ -54961,6 +54966,9 @@ function requireLoader() {
54961
54966
  }
54962
54967
  if (keyTag === "tag:yaml.org,2002:merge") {
54963
54968
  if (Array.isArray(valueNode)) {
54969
+ if (valueNode.length > 100) {
54970
+ throwError(state, "abnormal merge sequence size");
54971
+ }
54964
54972
  for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {
54965
54973
  mergeMappings(state, _result, valueNode[index], overridableKeys);
54966
54974
  }