oas 36.0.1 → 36.0.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.
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkBECL5BTEcjs = require('../chunk-BECL5BTE.cjs');
4
- require('../chunk-O2NUKZ7L.cjs');
3
+ var _chunkYKV73CBGcjs = require('../chunk-YKV73CBG.cjs');
4
+ require('../chunk-UDN4U5TL.cjs');
5
5
 
6
6
 
7
7
 
8
8
  var _chunkW6GBV2JTcjs = require('../chunk-W6GBV2JT.cjs');
9
- require('../chunk-C6QTUTTF.cjs');
9
+ require('../chunk-SCWW2SNX.cjs');
10
10
  require('../chunk-AYA3UT4L.cjs');
11
11
  require('../chunk-7PWF3F2W.cjs');
12
12
 
@@ -20,7 +20,7 @@ function callbacks(definition) {
20
20
  );
21
21
  }
22
22
  async function circularRefs(definition) {
23
- const oas = new (0, _chunkBECL5BTEcjs.Oas)(structuredClone(definition));
23
+ const oas = new (0, _chunkYKV73CBGcjs.Oas)(structuredClone(definition));
24
24
  await oas.dereference();
25
25
  const results = oas.getCircularReferences();
26
26
  results.sort();
@@ -33,7 +33,7 @@ function discriminators(definition) {
33
33
  return _chunkW6GBV2JTcjs.query.call(void 0, ["$..discriminator"], definition).map((res) => _chunkW6GBV2JTcjs.refizePointer.call(void 0, res.pointer));
34
34
  }
35
35
  async function fileSize(definition) {
36
- const oas = new (0, _chunkBECL5BTEcjs.Oas)(structuredClone(definition));
36
+ const oas = new (0, _chunkYKV73CBGcjs.Oas)(structuredClone(definition));
37
37
  const originalSizeInBytes = Buffer.from(JSON.stringify(oas.api)).length;
38
38
  const raw = Number((originalSizeInBytes / (1024 * 1024)).toFixed(2));
39
39
  await oas.dereference();
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  Oas
3
- } from "../chunk-QI6WI5AK.js";
4
- import "../chunk-GWZBWDMT.js";
3
+ } from "../chunk-IXQKQM3K.js";
4
+ import "../chunk-35LEYZEY.js";
5
5
  import {
6
6
  query,
7
7
  refizePointer
8
8
  } from "../chunk-CKC36IL7.js";
9
- import "../chunk-LYWP3CSV.js";
9
+ import "../chunk-6MDVLJ3A.js";
10
10
  import "../chunk-S27IGTVG.js";
11
11
  import "../chunk-XG4HGNCN.js";
12
12
 
@@ -15,7 +15,7 @@ import {
15
15
  mergeReferencedSchemasIntoRoot,
16
16
  supportedMethods,
17
17
  toJSONSchema
18
- } from "./chunk-LYWP3CSV.js";
18
+ } from "./chunk-6MDVLJ3A.js";
19
19
  import {
20
20
  getExtension
21
21
  } from "./chunk-S27IGTVG.js";
@@ -1870,4 +1870,4 @@ export {
1870
1870
  * @license Apache-2.0
1871
1871
  * @see {@link https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js}
1872
1872
  */
1873
- //# sourceMappingURL=chunk-GWZBWDMT.js.map
1873
+ //# sourceMappingURL=chunk-35LEYZEY.js.map
@@ -1342,6 +1342,10 @@ ${enums}`;
1342
1342
  }
1343
1343
 
1344
1344
  // src/operation/transformers/get-parameters-as-json-schema.ts
1345
+ var RESERVED_HEADER_PARAMETERS = /* @__PURE__ */ new Set(["accept", "authorization", "content-type"]);
1346
+ function isReservedHeaderParameter(param) {
1347
+ return param.in === "header" && RESERVED_HEADER_PARAMETERS.has(param.name.toLowerCase());
1348
+ }
1345
1349
  var types = {
1346
1350
  path: "Path Params",
1347
1351
  query: "Query Params",
@@ -1427,7 +1431,9 @@ function getParametersAsJSONSchema(operation, api, opts) {
1427
1431
  const operationParams = operation.getParameters();
1428
1432
  const transformed = Object.keys(types).map((type) => {
1429
1433
  const required = [];
1430
- const parameters = operationParams.filter((param) => param.in === type);
1434
+ const parameters = operationParams.filter((param) => {
1435
+ return param.in === type && !isReservedHeaderParameter(param);
1436
+ });
1431
1437
  if (parameters.length === 0) {
1432
1438
  return null;
1433
1439
  }
@@ -1577,4 +1583,4 @@ export {
1577
1583
  supportedMethods,
1578
1584
  SERVER_VARIABLE_REGEX
1579
1585
  };
1580
- //# sourceMappingURL=chunk-LYWP3CSV.js.map
1586
+ //# sourceMappingURL=chunk-6MDVLJ3A.js.map