docusaurus-plugin-openapi-docs 2.0.0-beta.3 → 2.0.0-beta.4

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/README.md CHANGED
@@ -22,7 +22,7 @@ The `docusaurus-plugin-openapi-docs` package extends the Docusaurus CLI with com
22
22
 
23
23
  Key Features:
24
24
 
25
- - **Compatible:** Works with Swagger 2.0 and OpenAPI 3.x.
25
+ - **Compatible:** Works with Swagger 2.0 and OpenAPI 3.0.
26
26
  - **Fast:** Convert large OpenAPI specs into MDX docs in seconds. 🔥
27
27
  - **Stylish:** Based on the same [Infima styling framework](https://infima.dev/) that powers the Docusaurus UI.
28
28
  - **Capable:** Supports single, multi and _even micro_ OpenAPI specs.
package/lib/index.js CHANGED
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.getDocsPluginConfig = exports.isURL = void 0;
13
13
  const fs_1 = __importDefault(require("fs"));
14
14
  const path_1 = __importDefault(require("path"));
15
+ const zlib_1 = __importDefault(require("zlib"));
15
16
  const utils_1 = require("@docusaurus/utils");
16
17
  const chalk_1 = __importDefault(require("chalk"));
17
18
  const mustache_1 = require("mustache");
@@ -200,7 +201,16 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
200
201
  }
201
202
  }
202
203
  if (item.type === "api") {
203
- item.json = JSON.stringify(item.api);
204
+ // opportunity to compress JSON
205
+ // const serialize = (o: any) => {
206
+ // return zlib.deflateSync(JSON.stringify(o)).toString("base64");
207
+ // };
208
+ // const deserialize = (s: any) => {
209
+ // return zlib.inflateSync(Buffer.from(s, "base64")).toString();
210
+ // };
211
+ item.json = zlib_1.default
212
+ .deflateSync(JSON.stringify(item.api))
213
+ .toString("base64");
204
214
  let infoBasePath = `${outputDir}/${item.infoId}`;
205
215
  if (docRouteBasePath) {
206
216
  infoBasePath = `${docRouteBasePath}/${outputDir
@@ -1,11 +1,4 @@
1
- import { MediaTypeObject, SchemaObject } from "../openapi/types";
2
- /**
3
- * Returns a merged representation of allOf array of schemas.
4
- */
5
- export declare function mergeAllOf(allOf: SchemaObject[]): {
6
- mergedSchemas: any;
7
- required: any;
8
- };
1
+ import { MediaTypeObject } from "../openapi/types";
9
2
  interface Props {
10
3
  style?: any;
11
4
  title: string;