docusaurus-plugin-openapi-docs 4.3.1 → 4.3.3

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.
Files changed (42) hide show
  1. package/README.md +2 -2
  2. package/lib/index.js +3 -4
  3. package/lib/markdown/createArrayBracket.js +2 -3
  4. package/lib/markdown/createAuthentication.js +1 -2
  5. package/lib/markdown/createAuthorization.js +1 -2
  6. package/lib/markdown/createCallbackMethodEndpoint.js +1 -2
  7. package/lib/markdown/createCallbacks.js +1 -2
  8. package/lib/markdown/createContactInfo.js +1 -2
  9. package/lib/markdown/createDeprecationNotice.js +1 -2
  10. package/lib/markdown/createDescription.js +1 -2
  11. package/lib/markdown/createDetails.js +1 -2
  12. package/lib/markdown/createDetailsSummary.js +1 -2
  13. package/lib/markdown/createDownload.js +1 -2
  14. package/lib/markdown/createHeading.js +1 -2
  15. package/lib/markdown/createLicense.js +1 -2
  16. package/lib/markdown/createLogo.js +1 -2
  17. package/lib/markdown/createMethodEndpoint.js +1 -2
  18. package/lib/markdown/createParamsDetails.js +1 -2
  19. package/lib/markdown/createRequestBodyDetails.js +1 -2
  20. package/lib/markdown/createRequestHeader.js +1 -2
  21. package/lib/markdown/createRequestSchema.js +1 -2
  22. package/lib/markdown/createResponseSchema.js +1 -2
  23. package/lib/markdown/createSchema.js +2 -3
  24. package/lib/markdown/createSchema.test.js +17 -7
  25. package/lib/markdown/createStatusCodes.js +2 -3
  26. package/lib/markdown/createTermsOfService.js +1 -2
  27. package/lib/markdown/createVendorExtensions.js +1 -2
  28. package/lib/markdown/createVersionBadge.js +1 -2
  29. package/lib/markdown/index.js +4 -5
  30. package/lib/markdown/schema.js +2 -3
  31. package/lib/markdown/utils.js +5 -5
  32. package/lib/openapi/createRequestExample.js +1 -1
  33. package/lib/openapi/openapi.js +6 -7
  34. package/lib/openapi/utils/loadAndResolveSpec.js +2 -3
  35. package/lib/openapi/utils/services/RedocNormalizedOptions.js +3 -3
  36. package/lib/openapi/utils/utils/helpers.js +17 -17
  37. package/lib/openapi/utils/utils/openapi.js +30 -30
  38. package/lib/sidebars/index.js +4 -7
  39. package/lib/sidebars/utils.js +2 -3
  40. package/package.json +3 -3
  41. package/src/openapi/createRequestExample.ts +1 -1
  42. package/src/sidebars/index.ts +1 -1
package/README.md CHANGED
@@ -41,7 +41,7 @@ Key Features:
41
41
 
42
42
  | Docusaurus OpenAPI Docs | Docusaurus |
43
43
  | ----------------------- | --------------- |
44
- | 4.0.x (current) | `3.5.0 - 3.6.x` |
44
+ | 4.0.x (current) | `3.5.0 - 3.7.x` |
45
45
  | 3.0.x (end-of-support) | `3.0.1 - 3.4.0` |
46
46
  | 2.2.3 (legacy) | `2.4.1 - 2.4.3` |
47
47
  | 1.7.3 (end-of-support) | `2.0.1 - 2.2.0` |
@@ -51,7 +51,7 @@ Key Features:
51
51
  Run the following to bootstrap a Docsaurus v3 site (classic theme) with `docusaurus-openapi-docs`:
52
52
 
53
53
  ```bash
54
- npx create-docusaurus@3.6.3 my-website --package-manager yarn
54
+ npx create-docusaurus@3.7.0 my-website --package-manager yarn
55
55
  ```
56
56
 
57
57
  > When prompted to select a template choose `Git repository`.
package/lib/index.js CHANGED
@@ -9,7 +9,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getDocsPluginConfig = exports.isURL = void 0;
12
+ exports.isURL = isURL;
13
+ exports.getDocsPluginConfig = getDocsPluginConfig;
14
+ exports.default = pluginOpenAPIDocs;
13
15
  const fs_1 = __importDefault(require("fs"));
14
16
  const path_1 = __importDefault(require("path"));
15
17
  const zlib_1 = __importDefault(require("zlib"));
@@ -24,7 +26,6 @@ const sidebars_1 = __importDefault(require("./sidebars"));
24
26
  function isURL(str) {
25
27
  return /^(https?:)\/\//m.test(str);
26
28
  }
27
- exports.isURL = isURL;
28
29
  function getDocsPluginConfig(presetsPlugins, plugin, pluginId) {
29
30
  // eslint-disable-next-line array-callback-return
30
31
  const filteredConfig = presetsPlugins.filter((data) => {
@@ -59,7 +60,6 @@ function getDocsPluginConfig(presetsPlugins, plugin, pluginId) {
59
60
  }
60
61
  return;
61
62
  }
62
- exports.getDocsPluginConfig = getDocsPluginConfig;
63
63
  function getPluginConfig(plugins, pluginId) {
64
64
  return plugins.filter((data) => data[1].id === pluginId)[0][1];
65
65
  }
@@ -702,7 +702,6 @@ custom_edit_url: null
702
702
  },
703
703
  };
704
704
  }
705
- exports.default = pluginOpenAPIDocs;
706
705
  pluginOpenAPIDocs.validateOptions = ({ options, validate }) => {
707
706
  const validatedOptions = validate(options_1.OptionsSchema, options);
708
707
  return validatedOptions;
@@ -6,7 +6,8 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createClosingArrayBracket = exports.createOpeningArrayBracket = void 0;
9
+ exports.createOpeningArrayBracket = createOpeningArrayBracket;
10
+ exports.createClosingArrayBracket = createClosingArrayBracket;
10
11
  const utils_1 = require("./utils");
11
12
  function createOpeningArrayBracket() {
12
13
  return (0, utils_1.create)("li", {
@@ -21,7 +22,6 @@ function createOpeningArrayBracket() {
21
22
  }),
22
23
  });
23
24
  }
24
- exports.createOpeningArrayBracket = createOpeningArrayBracket;
25
25
  function createClosingArrayBracket() {
26
26
  return (0, utils_1.create)("li", {
27
27
  children: (0, utils_1.create)("div", {
@@ -34,4 +34,3 @@ function createClosingArrayBracket() {
34
34
  }),
35
35
  });
36
36
  }
37
- exports.createClosingArrayBracket = createClosingArrayBracket;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createAuthentication = void 0;
9
+ exports.createAuthentication = createAuthentication;
10
10
  const createDescription_1 = require("./createDescription");
11
11
  const utils_1 = require("./utils");
12
12
  function createAuthentication(securitySchemes) {
@@ -169,4 +169,3 @@ function createAuthentication(securitySchemes) {
169
169
  style: { marginBottom: "2rem" },
170
170
  });
171
171
  }
172
- exports.createAuthentication = createAuthentication;
@@ -6,11 +6,10 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createAuthorization = void 0;
9
+ exports.createAuthorization = createAuthorization;
10
10
  const utils_1 = require("./utils");
11
11
  function createAuthorization(infoPath) {
12
12
  if (!infoPath)
13
13
  return undefined;
14
14
  return [(0, utils_1.create)("SecuritySchemes", { infoPath: infoPath }), "\n\n"];
15
15
  }
16
- exports.createAuthorization = createAuthorization;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createCallbackMethodEndpoint = void 0;
9
+ exports.createCallbackMethodEndpoint = createCallbackMethodEndpoint;
10
10
  const utils_1 = require("./utils");
11
11
  function createCallbackMethodEndpoint(method, path) {
12
12
  return [
@@ -18,4 +18,3 @@ function createCallbackMethodEndpoint(method, path) {
18
18
  "\n\n",
19
19
  ];
20
20
  }
21
- exports.createCallbackMethodEndpoint = createCallbackMethodEndpoint;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createCallbacks = void 0;
9
+ exports.createCallbacks = createCallbacks;
10
10
  const createCallbackMethodEndpoint_1 = require("./createCallbackMethodEndpoint");
11
11
  const createDescription_1 = require("./createDescription");
12
12
  const createRequestBodyDetails_1 = require("./createRequestBodyDetails");
@@ -75,4 +75,3 @@ function createCallbacks({ callbacks }) {
75
75
  ],
76
76
  });
77
77
  }
78
- exports.createCallbacks = createCallbacks;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createContactInfo = void 0;
9
+ exports.createContactInfo = createContactInfo;
10
10
  const utils_1 = require("./utils");
11
11
  function createContactInfo(contact) {
12
12
  if (!contact || !Object.keys(contact).length)
@@ -37,4 +37,3 @@ function createContactInfo(contact) {
37
37
  ],
38
38
  });
39
39
  }
40
- exports.createContactInfo = createContactInfo;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createDeprecationNotice = void 0;
9
+ exports.createDeprecationNotice = createDeprecationNotice;
10
10
  const utils_1 = require("./utils");
11
11
  function createAdmonition({ children }) {
12
12
  return `:::caution deprecated\n\n${(0, utils_1.render)(children)}\n\n:::`;
@@ -18,4 +18,3 @@ function createDeprecationNotice({ deprecated, description, }) {
18
18
  : "This endpoint has been deprecated and may be replaced or removed in future versions of the API.",
19
19
  }));
20
20
  }
21
- exports.createDeprecationNotice = createDeprecationNotice;
@@ -6,9 +6,8 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createDescription = void 0;
9
+ exports.createDescription = createDescription;
10
10
  const utils_1 = require("./utils");
11
11
  function createDescription(description) {
12
12
  return `\n\n${(0, utils_1.clean)(description)}\n\n`;
13
13
  }
14
- exports.createDescription = createDescription;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createDetails = void 0;
9
+ exports.createDetails = createDetails;
10
10
  const utils_1 = require("./utils");
11
11
  function createDetails({ children, style, ...rest }) {
12
12
  return (0, utils_1.create)("details", {
@@ -15,4 +15,3 @@ function createDetails({ children, style, ...rest }) {
15
15
  children,
16
16
  });
17
17
  }
18
- exports.createDetails = createDetails;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createDetailsSummary = void 0;
9
+ exports.createDetailsSummary = createDetailsSummary;
10
10
  const utils_1 = require("./utils");
11
11
  function createDetailsSummary({ children, style, ...rest }) {
12
12
  return (0, utils_1.create)("summary", {
@@ -15,4 +15,3 @@ function createDetailsSummary({ children, style, ...rest }) {
15
15
  children,
16
16
  });
17
17
  }
18
- exports.createDetailsSummary = createDetailsSummary;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createDownload = void 0;
9
+ exports.createDownload = createDownload;
10
10
  const utils_1 = require("./utils");
11
11
  function createDownload(url) {
12
12
  return (0, utils_1.guard)(url, (url) => [
@@ -14,4 +14,3 @@ function createDownload(url) {
14
14
  `\n\n`,
15
15
  ]);
16
16
  }
17
- exports.createDownload = createDownload;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createHeading = void 0;
9
+ exports.createHeading = createHeading;
10
10
  const utils_1 = require("./utils");
11
11
  function createHeading(heading) {
12
12
  return [
@@ -18,4 +18,3 @@ function createHeading(heading) {
18
18
  `\n\n`,
19
19
  ];
20
20
  }
21
- exports.createHeading = createHeading;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createLicense = void 0;
9
+ exports.createLicense = createLicense;
10
10
  const utils_1 = require("./utils");
11
11
  function createLicense(license) {
12
12
  if (!license || !Object.keys(license).length)
@@ -30,4 +30,3 @@ function createLicense(license) {
30
30
  ],
31
31
  });
32
32
  }
33
- exports.createLicense = createLicense;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createLogo = void 0;
9
+ exports.createLogo = createLogo;
10
10
  const utils_1 = require("./utils");
11
11
  function createLogo(logo, darkLogo) {
12
12
  return (0, utils_1.guard)(logo || darkLogo, () => [
@@ -16,4 +16,3 @@ function createLogo(logo, darkLogo) {
16
16
  }),
17
17
  ]);
18
18
  }
19
- exports.createLogo = createLogo;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createMethodEndpoint = void 0;
9
+ exports.createMethodEndpoint = createMethodEndpoint;
10
10
  const utils_1 = require("./utils");
11
11
  function createMethodEndpoint(method, path) {
12
12
  return [
@@ -18,4 +18,3 @@ function createMethodEndpoint(method, path) {
18
18
  "\n\n",
19
19
  ];
20
20
  }
21
- exports.createMethodEndpoint = createMethodEndpoint;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createParamsDetails = void 0;
9
+ exports.createParamsDetails = createParamsDetails;
10
10
  const utils_1 = require("./utils");
11
11
  function createParamsDetails({ parameters }) {
12
12
  return [
@@ -16,4 +16,3 @@ function createParamsDetails({ parameters }) {
16
16
  "\n\n",
17
17
  ];
18
18
  }
19
- exports.createParamsDetails = createParamsDetails;
@@ -6,9 +6,8 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createRequestBodyDetails = void 0;
9
+ exports.createRequestBodyDetails = createRequestBodyDetails;
10
10
  const createRequestSchema_1 = require("./createRequestSchema");
11
11
  function createRequestBodyDetails({ title, body }) {
12
12
  return (0, createRequestSchema_1.createRequestSchema)({ title, body });
13
13
  }
14
- exports.createRequestBodyDetails = createRequestBodyDetails;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createRequestHeader = void 0;
9
+ exports.createRequestHeader = createRequestHeader;
10
10
  const utils_1 = require("./utils");
11
11
  function createRequestHeader(header) {
12
12
  return [
@@ -19,4 +19,3 @@ function createRequestHeader(header) {
19
19
  `\n\n`,
20
20
  ];
21
21
  }
22
- exports.createRequestHeader = createRequestHeader;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createRequestSchema = void 0;
9
+ exports.createRequestSchema = createRequestSchema;
10
10
  const utils_1 = require("./utils");
11
11
  function createRequestSchema({ title, body, ...rest }) {
12
12
  return [
@@ -18,4 +18,3 @@ function createRequestSchema({ title, body, ...rest }) {
18
18
  "\n\n",
19
19
  ];
20
20
  }
21
- exports.createRequestSchema = createRequestSchema;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createResponseSchema = void 0;
9
+ exports.createResponseSchema = createResponseSchema;
10
10
  const utils_1 = require("./utils");
11
11
  function createResponseSchema({ title, body, ...rest }) {
12
12
  return [
@@ -18,4 +18,3 @@ function createResponseSchema({ title, body, ...rest }) {
18
18
  "\n\n",
19
19
  ];
20
20
  }
21
- exports.createResponseSchema = createResponseSchema;
@@ -9,7 +9,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.createNodes = exports.mergeAllOf = void 0;
12
+ exports.mergeAllOf = mergeAllOf;
13
+ exports.createNodes = createNodes;
13
14
  // eslint-disable-next-line import/no-extraneous-dependencies
14
15
  const allof_merge_1 = require("allof-merge");
15
16
  const clsx_1 = __importDefault(require("clsx"));
@@ -31,7 +32,6 @@ function mergeAllOf(allOf) {
31
32
  const mergedSchemas = (0, allof_merge_1.merge)(allOf, { onMergeError });
32
33
  return mergedSchemas;
33
34
  }
34
- exports.mergeAllOf = mergeAllOf;
35
35
  /**
36
36
  * For handling nested anyOf/oneOf.
37
37
  */
@@ -666,4 +666,3 @@ function createNodes(schema, schemaType) {
666
666
  // So far, haven't seen this hit in testing
667
667
  return "any";
668
668
  }
669
- exports.createNodes = createNodes;
@@ -21,13 +21,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
21
21
  }) : function(o, v) {
22
22
  o["default"] = v;
23
23
  });
24
- var __importStar = (this && this.__importStar) || function (mod) {
25
- if (mod && mod.__esModule) return mod;
26
- var result = {};
27
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
- __setModuleDefault(result, mod);
29
- return result;
30
- };
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
31
41
  Object.defineProperty(exports, "__esModule", { value: true });
32
42
  const prettier = __importStar(require("prettier"));
33
43
  const createSchema_1 = require("./createSchema");
@@ -6,7 +6,8 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createStatusCodes = void 0;
9
+ exports.default = json2xml;
10
+ exports.createStatusCodes = createStatusCodes;
10
11
  const utils_1 = require("./utils");
11
12
  function json2xml(o, tab) {
12
13
  var toXml = function (v, name, ind) {
@@ -50,7 +51,6 @@ function json2xml(o, tab) {
50
51
  xml += toXml(o[m3], m3, "");
51
52
  return tab ? xml.replace(/\t/g, tab) : xml.replace(/\t|\n/g, "");
52
53
  }
53
- exports.default = json2xml;
54
54
  function createStatusCodes({ id, label, responses }) {
55
55
  return [
56
56
  (0, utils_1.create)("StatusCodes", {
@@ -61,4 +61,3 @@ function createStatusCodes({ id, label, responses }) {
61
61
  "\n\n",
62
62
  ];
63
63
  }
64
- exports.createStatusCodes = createStatusCodes;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createTermsOfService = void 0;
9
+ exports.createTermsOfService = createTermsOfService;
10
10
  const utils_1 = require("./utils");
11
11
  function createTermsOfService(termsOfService) {
12
12
  if (!termsOfService)
@@ -29,4 +29,3 @@ function createTermsOfService(termsOfService) {
29
29
  ],
30
30
  });
31
31
  }
32
- exports.createTermsOfService = createTermsOfService;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createVendorExtensions = void 0;
9
+ exports.createVendorExtensions = createVendorExtensions;
10
10
  function createVendorExtensions(extensions) {
11
11
  if (!extensions || typeof extensions !== "object") {
12
12
  return undefined;
@@ -22,4 +22,3 @@ function createVendorExtensions(extensions) {
22
22
  ${rows.join("\n")}
23
23
  \`\`\`\n\n`;
24
24
  }
25
- exports.createVendorExtensions = createVendorExtensions;
@@ -6,7 +6,7 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createVersionBadge = void 0;
9
+ exports.createVersionBadge = createVersionBadge;
10
10
  const utils_1 = require("./utils");
11
11
  function createVersionBadge(version) {
12
12
  return (0, utils_1.guard)(version, (version) => [
@@ -17,4 +17,3 @@ function createVersionBadge(version) {
17
17
  `\n\n`,
18
18
  ]);
19
19
  }
20
- exports.createVersionBadge = createVersionBadge;
@@ -6,7 +6,10 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.createSchemaPageMD = exports.createTagPageMD = exports.createInfoPageMD = exports.createApiPageMD = void 0;
9
+ exports.createApiPageMD = createApiPageMD;
10
+ exports.createInfoPageMD = createInfoPageMD;
11
+ exports.createTagPageMD = createTagPageMD;
12
+ exports.createSchemaPageMD = createSchemaPageMD;
10
13
  const createAuthentication_1 = require("./createAuthentication");
11
14
  const createAuthorization_1 = require("./createAuthorization");
12
15
  const createCallbacks_1 = require("./createCallbacks");
@@ -53,7 +56,6 @@ function createApiPageMD({ title, api: { deprecated, "x-deprecated-description":
53
56
  (0, createCallbacks_1.createCallbacks)({ callbacks }),
54
57
  ]);
55
58
  }
56
- exports.createApiPageMD = createApiPageMD;
57
59
  function createInfoPageMD({ info: { title, version, description, contact, license, termsOfService, logo, darkLogo, }, securitySchemes, downloadUrl, }) {
58
60
  return (0, utils_1.render)([
59
61
  `import ApiLogo from "@theme/ApiLogo";\n`,
@@ -72,11 +74,9 @@ function createInfoPageMD({ info: { title, version, description, contact, licens
72
74
  (0, createLicense_1.createLicense)(license),
73
75
  ]);
74
76
  }
75
- exports.createInfoPageMD = createInfoPageMD;
76
77
  function createTagPageMD({ tag: { description } }) {
77
78
  return (0, utils_1.render)([(0, createDescription_1.createDescription)(description)]);
78
79
  }
79
- exports.createTagPageMD = createTagPageMD;
80
80
  function createSchemaPageMD({ schema }) {
81
81
  const { title = "", description } = schema;
82
82
  return (0, utils_1.render)([
@@ -90,4 +90,3 @@ function createSchemaPageMD({ schema }) {
90
90
  }),
91
91
  ]);
92
92
  }
93
- exports.createSchemaPageMD = createSchemaPageMD;
@@ -6,7 +6,8 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.getQualifierMessage = exports.getSchemaName = void 0;
9
+ exports.getSchemaName = getSchemaName;
10
+ exports.getQualifierMessage = getQualifierMessage;
10
11
  function prettyName(schema, circular) {
11
12
  var _a, _b, _c, _d, _e;
12
13
  if (schema.format) {
@@ -47,7 +48,6 @@ function getSchemaName(schema, circular) {
47
48
  }
48
49
  return (_a = prettyName(schema, circular)) !== null && _a !== void 0 ? _a : "";
49
50
  }
50
- exports.getSchemaName = getSchemaName;
51
51
  function getQualifierMessage(schema) {
52
52
  // TODO:
53
53
  // - uniqueItems
@@ -152,4 +152,3 @@ function getQualifierMessage(schema) {
152
152
  }
153
153
  return message + qualifierGroups.join(", ");
154
154
  }
155
- exports.getQualifierMessage = getQualifierMessage;
@@ -6,7 +6,11 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.clean = exports.codeBlock = exports.curlyBrackets = exports.codeFence = exports.greaterThan = exports.lessThan = exports.render = exports.guard = exports.create = void 0;
9
+ exports.codeBlock = exports.curlyBrackets = exports.codeFence = exports.greaterThan = exports.lessThan = void 0;
10
+ exports.create = create;
11
+ exports.guard = guard;
12
+ exports.render = render;
13
+ exports.clean = clean;
10
14
  function create(tag, props, options = {}) {
11
15
  const { children, ...rest } = props;
12
16
  let propString = "";
@@ -22,7 +26,6 @@ function create(tag, props, options = {}) {
22
26
  indentedChildren += indentedChildren ? "\n" : "";
23
27
  return `<${tag}${propString}>\n${indentedChildren}</${tag}>`;
24
28
  }
25
- exports.create = create;
26
29
  function guard(value, cb) {
27
30
  if (!!value || value === 0) {
28
31
  const children = cb(value);
@@ -30,7 +33,6 @@ function guard(value, cb) {
30
33
  }
31
34
  return "";
32
35
  }
33
- exports.guard = guard;
34
36
  function render(children) {
35
37
  if (Array.isArray(children)) {
36
38
  const filteredChildren = children.filter((c) => c !== undefined);
@@ -40,7 +42,6 @@ function render(children) {
40
42
  }
41
43
  return children !== null && children !== void 0 ? children : "";
42
44
  }
43
- exports.render = render;
44
45
  // Regex to selectively URL-encode '>' and '<' chars
45
46
  exports.lessThan = /<=?(?!(=|button|\s?\/button|code|\s?\/code|details|\s?\/details|summary|\s?\/summary|hr|\s?\/hr|br|\s?\/br|span|\s?\/span|strong|\s?\/strong|small|\s?\/small|table|\s?\/table|thead|\s?\/thead|tbody|\s?\/tbody|td|\s?\/td|tr|\s?\/tr|th|\s?\/th|h1|\s?\/h1|h2|\s?\/h2|h3|\s?\/h3|h4|\s?\/h4|h5|\s?\/h5|h6|\s?\/h6|title|\s?\/title|p|\s?\/p|em|\s?\/em|b|\s?\/b|i|\s?\/i|u|\s?\/u|strike|\s?\/strike|bold|\s?\/bold|a|\s?\/a|table|\s?\/table|li|\s?\/li|ol|\s?\/ol|ul|\s?\/ul|img|\s?\/img|svg|\s?\/svg|div|\s?\/div|center|\s?\/center))/gu;
46
47
  exports.greaterThan = /(?<!(button|code|details|summary|hr|br|span|strong|small|table|thead|tbody|td|tr|th|h1|h2|h3|h4|h5|h6|title|p|em|b|i|u|strike|bold|a|li|ol|ul|img|svg|div|center|\/|\s|"|'))>/gu;
@@ -65,4 +66,3 @@ function clean(value) {
65
66
  }
66
67
  return sections.join("");
67
68
  }
68
- exports.clean = clean;
@@ -149,7 +149,7 @@ const sampleRequestFromSchema = (schema = {}) => {
149
149
  if (Array.isArray(items === null || items === void 0 ? void 0 : items.oneOf)) {
150
150
  return items === null || items === void 0 ? void 0 : items.oneOf.map((item) => (0, exports.sampleRequestFromSchema)(item));
151
151
  }
152
- return [(0, exports.sampleRequestFromSchema)(items)];
152
+ return normalizeArray((0, exports.sampleRequestFromSchema)(items));
153
153
  }
154
154
  if (schemaCopy.enum) {
155
155
  if (schemaCopy.default) {
@@ -9,7 +9,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getTagDisplayName = exports.processOpenapiFile = exports.processOpenapiFiles = exports.readOpenapiFiles = void 0;
12
+ exports.readOpenapiFiles = readOpenapiFiles;
13
+ exports.processOpenapiFiles = processOpenapiFiles;
14
+ exports.processOpenapiFile = processOpenapiFile;
15
+ exports.getTagDisplayName = getTagDisplayName;
13
16
  const path_1 = __importDefault(require("path"));
14
17
  const utils_1 = require("@docusaurus/utils");
15
18
  const chalk_1 = __importDefault(require("chalk"));
@@ -443,7 +446,7 @@ async function readOpenapiFiles(openapiPath) {
443
446
  const fullPath = (0, utils_1.posixPath)(path_1.default.join(openapiPath, source));
444
447
  const data = (await (0, loadAndResolveSpec_1.loadAndResolveSpec)(fullPath));
445
448
  return {
446
- source: fullPath,
449
+ source: fullPath, // This will be aliased in process.
447
450
  sourceDirName: path_1.default.dirname(source),
448
451
  data,
449
452
  };
@@ -453,13 +456,12 @@ async function readOpenapiFiles(openapiPath) {
453
456
  const data = (await (0, loadAndResolveSpec_1.loadAndResolveSpec)(openapiPath));
454
457
  return [
455
458
  {
456
- source: openapiPath,
459
+ source: openapiPath, // This will be aliased in process.
457
460
  sourceDirName: ".",
458
461
  data,
459
462
  },
460
463
  ];
461
464
  }
462
- exports.readOpenapiFiles = readOpenapiFiles;
463
465
  async function processOpenapiFiles(files, options, sidebarOptions) {
464
466
  const promises = files.map(async (file) => {
465
467
  if (file.data !== undefined) {
@@ -507,7 +509,6 @@ async function processOpenapiFiles(files, options, sidebarOptions) {
507
509
  tagGroups,
508
510
  ];
509
511
  }
510
- exports.processOpenapiFiles = processOpenapiFiles;
511
512
  async function processOpenapiFile(openapiData, options, sidebarOptions) {
512
513
  const postmanCollection = await createPostmanCollection(openapiData);
513
514
  const items = createItems(openapiData, options, sidebarOptions);
@@ -522,7 +523,6 @@ async function processOpenapiFile(openapiData, options, sidebarOptions) {
522
523
  }
523
524
  return [items, tags, tagGroups];
524
525
  }
525
- exports.processOpenapiFile = processOpenapiFile;
526
526
  // order for picking items as a display name of tags
527
527
  const tagDisplayNameProperties = ["x-displayName", "name"];
528
528
  function getTagDisplayName(tagName, tags) {
@@ -542,4 +542,3 @@ function getTagDisplayName(tagName, tags) {
542
542
  // always default to the tagName
543
543
  return tagName;
544
544
  }
545
- exports.getTagDisplayName = getTagDisplayName;
@@ -9,7 +9,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.loadAndResolveSpec = exports.convertSwagger2OpenAPI = void 0;
12
+ exports.convertSwagger2OpenAPI = convertSwagger2OpenAPI;
13
+ exports.loadAndResolveSpec = loadAndResolveSpec;
13
14
  const json_schema_ref_parser_1 = __importDefault(require("@apidevtools/json-schema-ref-parser"));
14
15
  const openapi_core_1 = require("@redocly/openapi-core");
15
16
  const chalk_1 = __importDefault(require("chalk"));
@@ -72,7 +73,6 @@ function convertSwagger2OpenAPI(spec) {
72
73
  resolve(res && res.openapi);
73
74
  }));
74
75
  }
75
- exports.convertSwagger2OpenAPI = convertSwagger2OpenAPI;
76
76
  async function resolveJsonRefs(specUrlOrObject) {
77
77
  try {
78
78
  let schema = await json_schema_ref_parser_1.default.dereference(specUrlOrObject, {
@@ -151,4 +151,3 @@ async function loadAndResolveSpec(specUrlOrObject) {
151
151
  : decycled
152
152
  : resolved;
153
153
  }
154
- exports.loadAndResolveSpec = loadAndResolveSpec;
@@ -6,7 +6,8 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.RedocNormalizedOptions = exports.argValueToBoolean = exports.SideNavStyleEnum = void 0;
9
+ exports.RedocNormalizedOptions = exports.SideNavStyleEnum = void 0;
10
+ exports.argValueToBoolean = argValueToBoolean;
10
11
  // @ts-nocheck
11
12
  const helpers_1 = require("../utils/helpers");
12
13
  var SideNavStyleEnum;
@@ -14,7 +15,7 @@ var SideNavStyleEnum;
14
15
  SideNavStyleEnum["SummaryOnly"] = "summary-only";
15
16
  SideNavStyleEnum["PathOnly"] = "path-only";
16
17
  SideNavStyleEnum["IdOnly"] = "id-only";
17
- })(SideNavStyleEnum = exports.SideNavStyleEnum || (exports.SideNavStyleEnum = {}));
18
+ })(SideNavStyleEnum || (exports.SideNavStyleEnum = SideNavStyleEnum = {}));
18
19
  function argValueToBoolean(val, defaultValue) {
19
20
  if (val === undefined) {
20
21
  return defaultValue || false;
@@ -24,7 +25,6 @@ function argValueToBoolean(val, defaultValue) {
24
25
  }
25
26
  return val;
26
27
  }
27
- exports.argValueToBoolean = argValueToBoolean;
28
28
  function argValueToNumber(value) {
29
29
  if (typeof value === "string") {
30
30
  return parseInt(value, 10);
@@ -9,7 +9,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.isBoolean = exports.isArray = exports.unescapeHTMLChars = exports.escapeHTMLAttrChars = exports.removeQueryString = exports.titleize = exports.getBasePath = exports.resolveUrl = exports.isAbsoluteUrl = exports.safeSlugify = exports.isObject = exports.mergeObjects = exports.appendToMdHeading = exports.isNumeric = exports.stripTrailingSlash = exports.flattenByProp = exports.mapValues = exports.mapWithLast = void 0;
12
+ exports.isObject = exports.mergeObjects = void 0;
13
+ exports.mapWithLast = mapWithLast;
14
+ exports.mapValues = mapValues;
15
+ exports.flattenByProp = flattenByProp;
16
+ exports.stripTrailingSlash = stripTrailingSlash;
17
+ exports.isNumeric = isNumeric;
18
+ exports.appendToMdHeading = appendToMdHeading;
19
+ exports.safeSlugify = safeSlugify;
20
+ exports.isAbsoluteUrl = isAbsoluteUrl;
21
+ exports.resolveUrl = resolveUrl;
22
+ exports.getBasePath = getBasePath;
23
+ exports.titleize = titleize;
24
+ exports.removeQueryString = removeQueryString;
25
+ exports.escapeHTMLAttrChars = escapeHTMLAttrChars;
26
+ exports.unescapeHTMLChars = unescapeHTMLChars;
27
+ exports.isArray = isArray;
28
+ exports.isBoolean = isBoolean;
13
29
  // @ts-nocheck
14
30
  const slugify_1 = __importDefault(require("slugify"));
15
31
  /**
@@ -25,7 +41,6 @@ function mapWithLast(array, iteratee) {
25
41
  }
26
42
  return res;
27
43
  }
28
- exports.mapWithLast = mapWithLast;
29
44
  /**
30
45
  * Creates an object with the same keys as object and values generated by running each
31
46
  * own enumerable string keyed property of object thru iteratee.
@@ -43,7 +58,6 @@ function mapValues(object, iteratee) {
43
58
  }
44
59
  return res;
45
60
  }
46
- exports.mapValues = mapValues;
47
61
  /**
48
62
  * flattens collection using `prop` field as a children
49
63
  * @param collectionItems collection items
@@ -62,18 +76,15 @@ function flattenByProp(collectionItems, prop) {
62
76
  iterate(collectionItems);
63
77
  return res;
64
78
  }
65
- exports.flattenByProp = flattenByProp;
66
79
  function stripTrailingSlash(path) {
67
80
  if (path.endsWith("/")) {
68
81
  return path.substring(0, path.length - 1);
69
82
  }
70
83
  return path;
71
84
  }
72
- exports.stripTrailingSlash = stripTrailingSlash;
73
85
  function isNumeric(n) {
74
86
  return !isNaN(parseFloat(n)) && isFinite(n);
75
87
  }
76
- exports.isNumeric = isNumeric;
77
88
  function appendToMdHeading(md, heading, content) {
78
89
  // if heading is already in md and append to the end of it
79
90
  const testRegex = new RegExp(`(^|\\n)#\\s?${heading}\\s*\\n`, "i");
@@ -87,7 +98,6 @@ function appendToMdHeading(md, heading, content) {
87
98
  return `${md}${br}# ${heading}\n\n${content}`;
88
99
  }
89
100
  }
90
- exports.appendToMdHeading = appendToMdHeading;
91
101
  // credits https://stackoverflow.com/a/46973278/1749888
92
102
  const mergeObjects = (target, ...sources) => {
93
103
  if (!sources.length) {
@@ -136,11 +146,9 @@ function safeSlugify(value) {
136
146
  .replace(/^-+/, "") // Trim - from start of text
137
147
  .replace(/-+$/, "")); // Trim - from end of text
138
148
  }
139
- exports.safeSlugify = safeSlugify;
140
149
  function isAbsoluteUrl(url) {
141
150
  return /(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(url);
142
151
  }
143
- exports.isAbsoluteUrl = isAbsoluteUrl;
144
152
  /**
145
153
  * simple resolve URL which doesn't break on strings with url fragments
146
154
  * e.g. resolveUrl('http://test.com:{port}', 'path') results in http://test.com:{port}/path
@@ -173,7 +181,6 @@ function resolveUrl(url, to) {
173
181
  }
174
182
  return stripTrailingSlash(res);
175
183
  }
176
- exports.resolveUrl = resolveUrl;
177
184
  function getBasePath(serverUrl) {
178
185
  try {
179
186
  return parseURL(serverUrl).pathname;
@@ -183,11 +190,9 @@ function getBasePath(serverUrl) {
183
190
  return serverUrl;
184
191
  }
185
192
  }
186
- exports.getBasePath = getBasePath;
187
193
  function titleize(text) {
188
194
  return text.charAt(0).toUpperCase() + text.slice(1);
189
195
  }
190
- exports.titleize = titleize;
191
196
  function removeQueryString(serverUrl) {
192
197
  try {
193
198
  const url = parseURL(serverUrl);
@@ -199,7 +204,6 @@ function removeQueryString(serverUrl) {
199
204
  return serverUrl;
200
205
  }
201
206
  }
202
- exports.removeQueryString = removeQueryString;
203
207
  function parseURL(url) {
204
208
  if (typeof URL === "undefined") {
205
209
  // node
@@ -212,19 +216,15 @@ function parseURL(url) {
212
216
  function escapeHTMLAttrChars(str) {
213
217
  return str.replace(/["\\]/g, "\\$&");
214
218
  }
215
- exports.escapeHTMLAttrChars = escapeHTMLAttrChars;
216
219
  function unescapeHTMLChars(str) {
217
220
  return str
218
221
  .replace(/&#(\d+);/g, (_m, code) => String.fromCharCode(parseInt(code, 10)))
219
222
  .replace(/&amp;/g, "&")
220
223
  .replace(/&quot;/g, '"');
221
224
  }
222
- exports.unescapeHTMLChars = unescapeHTMLChars;
223
225
  function isArray(value) {
224
226
  return Array.isArray(value);
225
227
  }
226
- exports.isArray = isArray;
227
228
  function isBoolean(value) {
228
229
  return typeof value === "boolean";
229
230
  }
230
- exports.isBoolean = isBoolean;
@@ -6,7 +6,35 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.getContentWithLegacyExamples = exports.pluralizeType = exports.extractExtensions = exports.isRedocExtension = exports.shortenHTTPVerb = exports.setSecuritySchemePrefix = exports.SECURITY_SCHEMES_SECTION_PREFIX = exports.SCHEMA_DEFINITION_JSX_NAME = exports.SECURITY_DEFINITIONS_JSX_NAME = exports.normalizeServers = exports.expandDefaultServerVariables = exports.mergeSimilarMediaTypes = exports.mergeParams = exports.sortByField = exports.sortByRequired = exports.humanizeConstraints = exports.humanizeNumberRange = exports.getDefinitionName = exports.isNamedDefinition = exports.langFromMime = exports.getSerializedValue = exports.serializeParameterValue = exports.serializeParameterValueWithMime = exports.urlFormEncodePayload = exports.isFormUrlEncoded = exports.isJsonLike = exports.isPrimitiveType = exports.detectType = exports.getOperationSummary = exports.isOperationName = exports.getStatusCodeType = exports.isStatusCode = void 0;
9
+ exports.shortenHTTPVerb = exports.SECURITY_SCHEMES_SECTION_PREFIX = exports.SCHEMA_DEFINITION_JSX_NAME = exports.SECURITY_DEFINITIONS_JSX_NAME = void 0;
10
+ exports.isStatusCode = isStatusCode;
11
+ exports.getStatusCodeType = getStatusCodeType;
12
+ exports.isOperationName = isOperationName;
13
+ exports.getOperationSummary = getOperationSummary;
14
+ exports.detectType = detectType;
15
+ exports.isPrimitiveType = isPrimitiveType;
16
+ exports.isJsonLike = isJsonLike;
17
+ exports.isFormUrlEncoded = isFormUrlEncoded;
18
+ exports.urlFormEncodePayload = urlFormEncodePayload;
19
+ exports.serializeParameterValueWithMime = serializeParameterValueWithMime;
20
+ exports.serializeParameterValue = serializeParameterValue;
21
+ exports.getSerializedValue = getSerializedValue;
22
+ exports.langFromMime = langFromMime;
23
+ exports.isNamedDefinition = isNamedDefinition;
24
+ exports.getDefinitionName = getDefinitionName;
25
+ exports.humanizeNumberRange = humanizeNumberRange;
26
+ exports.humanizeConstraints = humanizeConstraints;
27
+ exports.sortByRequired = sortByRequired;
28
+ exports.sortByField = sortByField;
29
+ exports.mergeParams = mergeParams;
30
+ exports.mergeSimilarMediaTypes = mergeSimilarMediaTypes;
31
+ exports.expandDefaultServerVariables = expandDefaultServerVariables;
32
+ exports.normalizeServers = normalizeServers;
33
+ exports.setSecuritySchemePrefix = setSecuritySchemePrefix;
34
+ exports.isRedocExtension = isRedocExtension;
35
+ exports.extractExtensions = extractExtensions;
36
+ exports.pluralizeType = pluralizeType;
37
+ exports.getContentWithLegacyExamples = getContentWithLegacyExamples;
10
38
  // @ts-nocheck
11
39
  const path_1 = require("path");
12
40
  const helpers_1 = require("./helpers");
@@ -18,7 +46,6 @@ function isStatusCode(statusCode) {
18
46
  (0, helpers_1.isNumeric)(statusCode) ||
19
47
  isWildcardStatusCode(statusCode));
20
48
  }
21
- exports.isStatusCode = isStatusCode;
22
49
  function getStatusCodeType(statusCode, defaultAsError = false) {
23
50
  if (statusCode === "default") {
24
51
  return defaultAsError ? "error" : "success";
@@ -42,7 +69,6 @@ function getStatusCodeType(statusCode, defaultAsError = false) {
42
69
  }
43
70
  return res;
44
71
  }
45
- exports.getStatusCodeType = getStatusCodeType;
46
72
  const operationNames = {
47
73
  get: true,
48
74
  post: true,
@@ -56,7 +82,6 @@ const operationNames = {
56
82
  function isOperationName(key) {
57
83
  return key in operationNames;
58
84
  }
59
- exports.isOperationName = isOperationName;
60
85
  function getOperationSummary(operation) {
61
86
  return (operation.summary ||
62
87
  operation.operationId ||
@@ -64,7 +89,6 @@ function getOperationSummary(operation) {
64
89
  operation.pathName ||
65
90
  "<no summary>");
66
91
  }
67
- exports.getOperationSummary = getOperationSummary;
68
92
  const schemaKeywordTypes = {
69
93
  multipleOf: "number",
70
94
  maximum: "number",
@@ -101,7 +125,6 @@ function detectType(schema) {
101
125
  }
102
126
  return "any";
103
127
  }
104
- exports.detectType = detectType;
105
128
  function isPrimitiveType(schema, type = schema.type) {
106
129
  if (schema.oneOf !== undefined || schema.anyOf !== undefined) {
107
130
  return false;
@@ -128,15 +151,12 @@ function isPrimitiveType(schema, type = schema.type) {
128
151
  }
129
152
  return isPrimitive;
130
153
  }
131
- exports.isPrimitiveType = isPrimitiveType;
132
154
  function isJsonLike(contentType) {
133
155
  return contentType.search(/json/i) !== -1;
134
156
  }
135
- exports.isJsonLike = isJsonLike;
136
157
  function isFormUrlEncoded(contentType) {
137
158
  return contentType === "application/x-www-form-urlencoded";
138
159
  }
139
- exports.isFormUrlEncoded = isFormUrlEncoded;
140
160
  function delimitedEncodeField(fieldVal, fieldName, delimiter) {
141
161
  if ((0, helpers_1.isArray)(fieldVal)) {
142
162
  return fieldVal.map((v) => v.toString()).join(delimiter);
@@ -208,7 +228,6 @@ function urlFormEncodePayload(payload, encoding = {}) {
208
228
  .join("&");
209
229
  }
210
230
  }
211
- exports.urlFormEncodePayload = urlFormEncodePayload;
212
231
  function serializePathParameter(name, style, explode, value) {
213
232
  const suffix = explode ? "*" : "";
214
233
  let prefix = "";
@@ -290,7 +309,6 @@ function serializeParameterValueWithMime(value, mime) {
290
309
  return "";
291
310
  }
292
311
  }
293
- exports.serializeParameterValueWithMime = serializeParameterValueWithMime;
294
312
  function serializeParameterValue(parameter, value) {
295
313
  const { name, style, explode = false, serializationMime } = parameter;
296
314
  if (serializationMime) {
@@ -324,7 +342,6 @@ function serializeParameterValue(parameter, value) {
324
342
  return "";
325
343
  }
326
344
  }
327
- exports.serializeParameterValue = serializeParameterValue;
328
345
  function getSerializedValue(field, example) {
329
346
  if (field.in) {
330
347
  // decode for better readability in examples: see https://github.com/Redocly/redoc/issues/1138
@@ -334,25 +351,21 @@ function getSerializedValue(field, example) {
334
351
  return example;
335
352
  }
336
353
  }
337
- exports.getSerializedValue = getSerializedValue;
338
354
  function langFromMime(contentType) {
339
355
  if (contentType.search(/xml/i) !== -1) {
340
356
  return "xml";
341
357
  }
342
358
  return "clike";
343
359
  }
344
- exports.langFromMime = langFromMime;
345
360
  const DEFINITION_NAME_REGEX = /^#\/components\/(schemas|pathItems)\/([^/]+)$/;
346
361
  function isNamedDefinition(pointer) {
347
362
  return DEFINITION_NAME_REGEX.test(pointer || "");
348
363
  }
349
- exports.isNamedDefinition = isNamedDefinition;
350
364
  function getDefinitionName(pointer) {
351
365
  var _a;
352
366
  const [name] = ((_a = pointer === null || pointer === void 0 ? void 0 : pointer.match(DEFINITION_NAME_REGEX)) === null || _a === void 0 ? void 0 : _a.reverse()) || [];
353
367
  return name;
354
368
  }
355
- exports.getDefinitionName = getDefinitionName;
356
369
  function humanizeMultipleOfConstraint(multipleOf) {
357
370
  if (multipleOf === undefined) {
358
371
  return;
@@ -406,7 +419,6 @@ function humanizeNumberRange(schema) {
406
419
  return `${exclusiveMinimum ? "> " : ">= "}${minimum}`;
407
420
  }
408
421
  }
409
- exports.humanizeNumberRange = humanizeNumberRange;
410
422
  function humanizeConstraints(schema) {
411
423
  const res = [];
412
424
  const stringRange = humanizeRangeConstraint("characters", schema.minLength, schema.maxLength);
@@ -434,7 +446,6 @@ function humanizeConstraints(schema) {
434
446
  }
435
447
  return res;
436
448
  }
437
- exports.humanizeConstraints = humanizeConstraints;
438
449
  function sortByRequired(fields, order = []) {
439
450
  const unrequiredFields = [];
440
451
  const orderedFields = [];
@@ -452,13 +463,11 @@ function sortByRequired(fields, order = []) {
452
463
  orderedFields.sort((a, b) => order.indexOf(a.name) - order.indexOf(b.name));
453
464
  return [...orderedFields, ...unorderedFields, ...unrequiredFields];
454
465
  }
455
- exports.sortByRequired = sortByRequired;
456
466
  function sortByField(fields, param) {
457
467
  return [...fields].sort((a, b) => {
458
468
  return a[param].localeCompare(b[param]);
459
469
  });
460
470
  }
461
- exports.sortByField = sortByField;
462
471
  function mergeParams(parser, pathParams = [], operationParams = []) {
463
472
  const operationParamNames = {};
464
473
  operationParams.forEach((param) => {
@@ -472,7 +481,6 @@ function mergeParams(parser, pathParams = [], operationParams = []) {
472
481
  });
473
482
  return pathParams.concat(operationParams);
474
483
  }
475
- exports.mergeParams = mergeParams;
476
484
  function mergeSimilarMediaTypes(types) {
477
485
  const mergedTypes = {};
478
486
  Object.keys(types).forEach((name) => {
@@ -490,11 +498,9 @@ function mergeSimilarMediaTypes(types) {
490
498
  });
491
499
  return mergedTypes;
492
500
  }
493
- exports.mergeSimilarMediaTypes = mergeSimilarMediaTypes;
494
501
  function expandDefaultServerVariables(url, variables = {}) {
495
502
  return url.replace(/(?:{)([\w-.]+)(?:})/g, (match, name) => (variables[name] && variables[name].default) || match);
496
503
  }
497
- exports.expandDefaultServerVariables = expandDefaultServerVariables;
498
504
  function normalizeServers(specUrl, servers) {
499
505
  const getHref = () => {
500
506
  if (!false) {
@@ -523,14 +529,12 @@ function normalizeServers(specUrl, servers) {
523
529
  };
524
530
  });
525
531
  }
526
- exports.normalizeServers = normalizeServers;
527
532
  exports.SECURITY_DEFINITIONS_JSX_NAME = "SecurityDefinitions";
528
533
  exports.SCHEMA_DEFINITION_JSX_NAME = "SchemaDefinition";
529
534
  exports.SECURITY_SCHEMES_SECTION_PREFIX = "section/Authentication/";
530
535
  function setSecuritySchemePrefix(prefix) {
531
536
  exports.SECURITY_SCHEMES_SECTION_PREFIX = prefix;
532
537
  }
533
- exports.setSecuritySchemePrefix = setSecuritySchemePrefix;
534
538
  const shortenHTTPVerb = (verb) => ({
535
539
  delete: "del",
536
540
  options: "opts",
@@ -539,7 +543,7 @@ exports.shortenHTTPVerb = shortenHTTPVerb;
539
543
  function isRedocExtension(key) {
540
544
  const redocExtensions = {
541
545
  "x-circular-ref": true,
542
- "x-code-samples": true,
546
+ "x-code-samples": true, // deprecated
543
547
  "x-codeSamples": true,
544
548
  "x-displayName": true,
545
549
  "x-examples": true,
@@ -554,7 +558,6 @@ function isRedocExtension(key) {
554
558
  };
555
559
  return key in redocExtensions;
556
560
  }
557
- exports.isRedocExtension = isRedocExtension;
558
561
  function extractExtensions(obj, showExtensions) {
559
562
  return Object.keys(obj)
560
563
  .filter((key) => {
@@ -568,14 +571,12 @@ function extractExtensions(obj, showExtensions) {
568
571
  return acc;
569
572
  }, {});
570
573
  }
571
- exports.extractExtensions = extractExtensions;
572
574
  function pluralizeType(displayType) {
573
575
  return displayType
574
576
  .split(" or ")
575
577
  .map((type) => type.replace(/^(string|object|number|integer|array|boolean)s?( ?.*)/, "$1s$2"))
576
578
  .join(" or ");
577
579
  }
578
- exports.pluralizeType = pluralizeType;
579
580
  function getContentWithLegacyExamples(info) {
580
581
  let mediaContent = info.content;
581
582
  const xExamples = info["x-examples"]; // converted from OAS2 body param
@@ -602,4 +603,3 @@ function getContentWithLegacyExamples(info) {
602
603
  }
603
604
  return mediaContent;
604
605
  }
605
- exports.getContentWithLegacyExamples = getContentWithLegacyExamples;
@@ -9,6 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.default = generateSidebarSlice;
12
13
  const path_1 = __importDefault(require("path"));
13
14
  const utils_1 = require("@docusaurus/utils");
14
15
  const clsx_1 = __importDefault(require("clsx"));
@@ -102,12 +103,9 @@ function groupByTags(items, sidebarOptions, options, tags, docPath) {
102
103
  var _a;
103
104
  // Map info object to tag
104
105
  const taggedInfoObject = intros.find((i) => i.tags ? i.tags.find((t) => t.name === tag) : undefined);
105
- const tagObject = tags.flat().find((t) => {
106
- var _a;
107
- return (_a = tag === t.name) !== null && _a !== void 0 ? _a : {
108
- name: tag,
109
- description: `${tag} Index`,
110
- };
106
+ const tagObject = tags.flat().find((t) => tag === t.name && {
107
+ name: tag,
108
+ description: `${tag} Index`,
111
109
  });
112
110
  // TODO: perhaps move this into a getLinkConfig() function
113
111
  // Default to no link config (spindowns only)
@@ -226,4 +224,3 @@ function generateSidebarSlice(sidebarOptions, options, api, tags, docPath, tagGr
226
224
  }
227
225
  return sidebarSlice;
228
226
  }
229
- exports.default = generateSidebarSlice;
@@ -6,7 +6,8 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  * ========================================================================== */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.versionCrumb = exports.versionSelector = void 0;
9
+ exports.versionSelector = versionSelector;
10
+ exports.versionCrumb = versionCrumb;
10
11
  const mustache_1 = require("mustache");
11
12
  function versionSelector(versions) {
12
13
  const template = `<div class="dropdown dropdown--hoverable dropdown--right">
@@ -19,7 +20,6 @@ function versionSelector(versions) {
19
20
  const view = (0, mustache_1.render)(template, versions);
20
21
  return view;
21
22
  }
22
- exports.versionSelector = versionSelector;
23
23
  function versionCrumb(version) {
24
24
  const template = `<ul style="display: flex;" class="breadcrumbs breadcrumbs--sm">
25
25
  <li style="margin-left: auto; margin-right: 0;" class="breadcrumbs__item breadcrumbs__item--active">
@@ -28,4 +28,3 @@ function versionCrumb(version) {
28
28
  const view = (0, mustache_1.render)(template, version);
29
29
  return view;
30
30
  }
31
- exports.versionCrumb = versionCrumb;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "docusaurus-plugin-openapi-docs",
3
3
  "description": "OpenAPI plugin for Docusaurus.",
4
- "version": "4.3.1",
4
+ "version": "4.3.3",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -60,10 +60,10 @@
60
60
  "@docusaurus/plugin-content-docs": "^3.5.0",
61
61
  "@docusaurus/utils": "^3.5.0",
62
62
  "@docusaurus/utils-validation": "^3.5.0",
63
- "react": "^16.8.4 || ^17.0.0 || ^18.0.0"
63
+ "react": "^16.8.4 || ^17.0.0 || ^18.0.0 || ^19.0.0"
64
64
  },
65
65
  "engines": {
66
66
  "node": ">=14"
67
67
  },
68
- "gitHead": "78bfd444c557f94a67344d6276025f4958a921bd"
68
+ "gitHead": "4ec42960414d640952c235afc3757fd3245fb2d2"
69
69
  }
@@ -181,7 +181,7 @@ export const sampleRequestFromSchema = (schema: SchemaObject = {}): any => {
181
181
  return items?.oneOf.map((item: any) => sampleRequestFromSchema(item));
182
182
  }
183
183
 
184
- return [sampleRequestFromSchema(items)];
184
+ return normalizeArray(sampleRequestFromSchema(items));
185
185
  }
186
186
 
187
187
  if (schemaCopy.enum) {
@@ -154,7 +154,7 @@ function groupByTags(
154
154
  );
155
155
  const tagObject = tags.flat().find(
156
156
  (t) =>
157
- tag === t.name ?? {
157
+ tag === t.name && {
158
158
  name: tag,
159
159
  description: `${tag} Index`,
160
160
  }