docusaurus-plugin-openapi-docs 0.0.0-613 → 0.0.0-616
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/lib/index.js +11 -1
- package/lib/markdown/createRequestSchema.d.ts +1 -8
- package/lib/markdown/createRequestSchema.js +4 -684
- package/lib/markdown/createResponseSchema.d.ts +1 -8
- package/lib/markdown/createResponseSchema.js +3 -685
- package/lib/markdown/createSchema.d.ts +12 -0
- package/lib/markdown/createSchema.js +594 -0
- package/lib/openapi/createRequestExample.js +3 -3
- package/lib/openapi/createResponseExample.js +3 -3
- package/package.json +2 -2
- package/src/index.ts +11 -1
- package/src/markdown/createRequestSchema.ts +2 -891
- package/src/markdown/createResponseSchema.ts +2 -894
- package/src/markdown/createSchema.ts +793 -0
- package/src/openapi/createRequestExample.ts +1 -1
- package/src/openapi/createResponseExample.ts +1 -1
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import fs from "fs";
|
|
9
9
|
import path from "path";
|
|
10
|
+
import zlib from "zlib";
|
|
10
11
|
|
|
11
12
|
import type { LoadContext, Plugin } from "@docusaurus/types";
|
|
12
13
|
import { Globby, posixPath } from "@docusaurus/utils";
|
|
@@ -264,7 +265,16 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
|
|
|
264
265
|
: tagPageGenerator(item);
|
|
265
266
|
item.markdown = markdown;
|
|
266
267
|
if (item.type === "api") {
|
|
267
|
-
|
|
268
|
+
// opportunity to compress JSON
|
|
269
|
+
// const serialize = (o: any) => {
|
|
270
|
+
// return zlib.deflateSync(JSON.stringify(o)).toString("base64");
|
|
271
|
+
// };
|
|
272
|
+
// const deserialize = (s: any) => {
|
|
273
|
+
// return zlib.inflateSync(Buffer.from(s, "base64")).toString();
|
|
274
|
+
// };
|
|
275
|
+
item.json = zlib
|
|
276
|
+
.deflateSync(JSON.stringify(item.api))
|
|
277
|
+
.toString("base64");
|
|
268
278
|
let infoBasePath = `${outputDir}/${item.infoId}`;
|
|
269
279
|
if (docRouteBasePath) {
|
|
270
280
|
infoBasePath = `${docRouteBasePath}/${outputDir
|