docusaurus-plugin-openapi-docs 4.0.1 → 4.2.0
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 +11 -0
- package/lib/index.js +4 -0
- package/lib/markdown/createCallbackMethodEndpoint.d.ts +1 -0
- package/lib/markdown/createCallbackMethodEndpoint.js +21 -0
- package/lib/markdown/createCallbacks.js +2 -2
- package/lib/markdown/createContactInfo.js +1 -1
- package/lib/markdown/createDeprecationNotice.js +5 -6
- package/lib/markdown/createMethodEndpoint.js +8 -1
- package/lib/markdown/createParamsDetails.d.ts +1 -2
- package/lib/markdown/createParamsDetails.js +7 -36
- package/lib/markdown/createRequestBodyDetails.d.ts +1 -1
- package/lib/markdown/createRequestSchema.d.ts +1 -1
- package/lib/markdown/createRequestSchema.js +8 -132
- package/lib/markdown/createResponseSchema.d.ts +1 -1
- package/lib/markdown/createResponseSchema.js +8 -94
- package/lib/markdown/createSchema.d.ts +1 -4
- package/lib/markdown/createSchema.js +35 -50
- package/lib/markdown/createSchema.test.js +48 -0
- package/lib/markdown/createStatusCodes.d.ts +1 -4
- package/lib/markdown/createStatusCodes.js +10 -259
- package/lib/markdown/index.js +11 -22
- package/lib/markdown/utils.d.ts +4 -0
- package/lib/openapi/createRequestExample.js +2 -2
- package/lib/openapi/createResponseExample.js +2 -2
- package/lib/openapi/openapi.js +16 -14
- package/lib/openapi/types.d.ts +4 -0
- package/lib/openapi/utils/services/OpenAPIParser.js +1 -1
- package/lib/options.js +5 -0
- package/lib/sidebars/index.js +32 -26
- package/lib/types.d.ts +9 -0
- package/package.json +7 -7
- package/src/index.ts +4 -0
- package/src/markdown/__snapshots__/createSchema.test.ts.snap +142 -0
- package/src/markdown/createCallbackMethodEndpoint.ts +19 -0
- package/src/markdown/createCallbacks.ts +2 -2
- package/src/markdown/createContactInfo.ts +1 -1
- package/src/markdown/createDeprecationNotice.ts +3 -2
- package/src/markdown/createMethodEndpoint.ts +8 -1
- package/src/markdown/createParamsDetails.ts +7 -42
- package/src/markdown/createRequestSchema.ts +9 -143
- package/src/markdown/createResponseSchema.ts +9 -112
- package/src/markdown/createSchema.test.ts +64 -0
- package/src/markdown/createSchema.ts +30 -50
- package/src/markdown/createStatusCodes.ts +9 -268
- package/src/markdown/index.ts +11 -22
- package/src/markdown/utils.ts +4 -0
- package/src/openapi/createRequestExample.ts +2 -5
- package/src/openapi/createResponseExample.ts +2 -5
- package/src/openapi/openapi.ts +4 -2
- package/src/openapi/types.ts +4 -0
- package/src/openapi/utils/loadAndResolveSpec.ts +1 -1
- package/src/openapi/utils/services/OpenAPIParser.ts +1 -0
- package/src/options.ts +6 -0
- package/src/sidebars/index.ts +47 -40
- package/src/types.ts +11 -0
package/src/types.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
* ========================================================================== */
|
|
7
7
|
|
|
8
|
+
import { SidebarItemDoc } from "@docusaurus/plugin-content-docs/src/sidebars/types";
|
|
8
9
|
import type Request from "postman-collection";
|
|
9
10
|
|
|
10
11
|
import {
|
|
@@ -57,12 +58,22 @@ export interface MarkdownGenerator {
|
|
|
57
58
|
createSchemaPageMD?: (pageData: SchemaPageMetadata) => string;
|
|
58
59
|
}
|
|
59
60
|
|
|
61
|
+
export type ApiDocItemGenerator = (
|
|
62
|
+
item: ApiPageMetadata | SchemaPageMetadata,
|
|
63
|
+
context: { sidebarOptions: SidebarOptions; basePath: string }
|
|
64
|
+
) => SidebarItemDoc;
|
|
65
|
+
|
|
66
|
+
export interface SidebarGenerators {
|
|
67
|
+
createDocItem?: ApiDocItemGenerator;
|
|
68
|
+
}
|
|
69
|
+
|
|
60
70
|
export interface SidebarOptions {
|
|
61
71
|
groupPathsBy?: string;
|
|
62
72
|
categoryLinkSource?: "info" | "tag" | "auto";
|
|
63
73
|
customProps?: { [key: string]: unknown };
|
|
64
74
|
sidebarCollapsible?: boolean;
|
|
65
75
|
sidebarCollapsed?: boolean;
|
|
76
|
+
sidebarGenerators?: SidebarGenerators;
|
|
66
77
|
}
|
|
67
78
|
|
|
68
79
|
export interface APIVersionOptions {
|