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 +1 -1
- package/lib/index.js +11 -1
- package/lib/markdown/createRequestSchema.d.ts +1 -8
- package/lib/markdown/createRequestSchema.js +4 -643
- package/lib/markdown/createResponseSchema.d.ts +1 -8
- package/lib/markdown/createResponseSchema.js +3 -644
- package/lib/markdown/createSchema.d.ts +12 -0
- package/lib/markdown/createSchema.js +647 -0
- package/lib/markdown/index.js +3 -3
- 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 -841
- package/src/markdown/createResponseSchema.ts +2 -843
- package/src/markdown/createSchema.ts +850 -0
- package/src/markdown/index.ts +3 -3
- package/src/openapi/createRequestExample.ts +1 -1
- package/src/openapi/createResponseExample.ts +1 -1
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.
|
|
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
|
-
|
|
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
|
|
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;
|