docusaurus-plugin-openapi-docs 0.0.0-757 → 0.0.0-759
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/markdown/createSchema.js +7 -0
- package/lib/markdown/createStatusCodes.js +12 -8
- package/lib/markdown/index.js +0 -1
- package/package.json +2 -2
- package/src/markdown/__snapshots__/createSchema.test.ts.snap +12 -0
- package/src/markdown/createSchema.ts +10 -0
- package/src/markdown/createStatusCodes.ts +12 -8
- package/src/markdown/index.ts +0 -1
|
@@ -69,6 +69,13 @@ function createAnyOneOf(schema) {
|
|
|
69
69
|
? anyOneSchema.title
|
|
70
70
|
: `MOD${index + 1}`;
|
|
71
71
|
const anyOneChildren = [];
|
|
72
|
+
if (anyOneSchema.description) {
|
|
73
|
+
anyOneChildren.push((0, utils_1.create)("div", {
|
|
74
|
+
style: { marginTop: ".5rem", marginBottom: ".5rem" },
|
|
75
|
+
className: "openapi-schema__summary",
|
|
76
|
+
children: (0, createDescription_1.createDescription)(anyOneSchema.description),
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
72
79
|
if (anyOneSchema.type === "object" &&
|
|
73
80
|
!anyOneSchema.properties &&
|
|
74
81
|
!anyOneSchema.allOf &&
|
|
@@ -118,8 +118,9 @@ function createResponseExamples(responseExamples, mimeType) {
|
|
|
118
118
|
value: `${exampleName}`,
|
|
119
119
|
children: [
|
|
120
120
|
(0, utils_2.guard)(exampleValue.summary, (summary) => [
|
|
121
|
-
(0, utils_1.create)("
|
|
122
|
-
children:
|
|
121
|
+
(0, utils_1.create)("div", {
|
|
122
|
+
children: `${summary}`,
|
|
123
|
+
className: "openapi-example__summary",
|
|
123
124
|
}),
|
|
124
125
|
]),
|
|
125
126
|
(0, utils_1.create)("ResponseSamples", {
|
|
@@ -134,8 +135,9 @@ function createResponseExamples(responseExamples, mimeType) {
|
|
|
134
135
|
value: `${exampleName}`,
|
|
135
136
|
children: [
|
|
136
137
|
(0, utils_2.guard)(exampleValue.summary, (summary) => [
|
|
137
|
-
(0, utils_1.create)("
|
|
138
|
-
children:
|
|
138
|
+
(0, utils_1.create)("div", {
|
|
139
|
+
children: `${summary}`,
|
|
140
|
+
className: "openapi-example__summary",
|
|
139
141
|
}),
|
|
140
142
|
]),
|
|
141
143
|
(0, utils_1.create)("ResponseSamples", {
|
|
@@ -161,8 +163,9 @@ function createResponseExample(responseExample, mimeType) {
|
|
|
161
163
|
value: `Example`,
|
|
162
164
|
children: [
|
|
163
165
|
(0, utils_2.guard)(responseExample.summary, (summary) => [
|
|
164
|
-
(0, utils_1.create)("
|
|
165
|
-
children:
|
|
166
|
+
(0, utils_1.create)("div", {
|
|
167
|
+
children: `${summary}`,
|
|
168
|
+
className: "openapi-example__summary",
|
|
166
169
|
}),
|
|
167
170
|
]),
|
|
168
171
|
(0, utils_1.create)("ResponseSamples", {
|
|
@@ -177,8 +180,9 @@ function createResponseExample(responseExample, mimeType) {
|
|
|
177
180
|
value: `Example`,
|
|
178
181
|
children: [
|
|
179
182
|
(0, utils_2.guard)(responseExample.summary, (summary) => [
|
|
180
|
-
(0, utils_1.create)("
|
|
181
|
-
children:
|
|
183
|
+
(0, utils_1.create)("div", {
|
|
184
|
+
children: `${summary}`,
|
|
185
|
+
className: "openapi-example__summary",
|
|
182
186
|
}),
|
|
183
187
|
]),
|
|
184
188
|
(0, utils_1.create)("ResponseSamples", {
|
package/lib/markdown/index.js
CHANGED
|
@@ -38,7 +38,6 @@ function createApiPageMD({ title, api: { deprecated, "x-deprecated-description":
|
|
|
38
38
|
`import ResponseSamples from "@theme/ResponseSamples";\n`,
|
|
39
39
|
`import SchemaItem from "@theme/SchemaItem";\n`,
|
|
40
40
|
`import SchemaTabs from "@theme/SchemaTabs";\n`,
|
|
41
|
-
`import Markdown from "@theme/Markdown";\n`,
|
|
42
41
|
`import Heading from "@theme/Heading";\n`,
|
|
43
42
|
`import OperationTabs from "@theme/OperationTabs";\n`,
|
|
44
43
|
`import TabItem from "@theme/TabItem";\n\n`,
|
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": "0.0.0-
|
|
4
|
+
"version": "0.0.0-759",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=14"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "21b2b166a63e0f1c00b59518785c1a0545512d38"
|
|
66
66
|
}
|
|
@@ -240,6 +240,12 @@ Array [
|
|
|
240
240
|
</span>
|
|
241
241
|
<SchemaTabs>
|
|
242
242
|
<TabItem label={\\"MOD1\\"} value={\\"0-item-properties\\"}>
|
|
243
|
+
<div
|
|
244
|
+
style={{ marginTop: \\".5rem\\", marginBottom: \\".5rem\\" }}
|
|
245
|
+
className={\\"openapi-schema__summary\\"}
|
|
246
|
+
>
|
|
247
|
+
Clown's nose length
|
|
248
|
+
</div>
|
|
243
249
|
<SchemaItem
|
|
244
250
|
collapsible={false}
|
|
245
251
|
name={\\"noseLength\\"}
|
|
@@ -250,6 +256,12 @@ Array [
|
|
|
250
256
|
></SchemaItem>
|
|
251
257
|
</TabItem>
|
|
252
258
|
<TabItem label={\\"MOD2\\"} value={\\"1-item-properties\\"}>
|
|
259
|
+
<div
|
|
260
|
+
style={{ marginTop: \\".5rem\\", marginBottom: \\".5rem\\" }}
|
|
261
|
+
className={\\"openapi-schema__summary\\"}
|
|
262
|
+
>
|
|
263
|
+
Array of strings
|
|
264
|
+
</div>
|
|
253
265
|
<li>
|
|
254
266
|
<div
|
|
255
267
|
style={{
|
|
@@ -75,6 +75,16 @@ function createAnyOneOf(schema: SchemaObject): any {
|
|
|
75
75
|
: `MOD${index + 1}`;
|
|
76
76
|
const anyOneChildren = [];
|
|
77
77
|
|
|
78
|
+
if (anyOneSchema.description) {
|
|
79
|
+
anyOneChildren.push(
|
|
80
|
+
create("div", {
|
|
81
|
+
style: { marginTop: ".5rem", marginBottom: ".5rem" },
|
|
82
|
+
className: "openapi-schema__summary",
|
|
83
|
+
children: createDescription(anyOneSchema.description),
|
|
84
|
+
})
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
78
88
|
if (
|
|
79
89
|
anyOneSchema.type === "object" &&
|
|
80
90
|
!anyOneSchema.properties &&
|
|
@@ -127,8 +127,9 @@ export function createResponseExamples(
|
|
|
127
127
|
value: `${exampleName}`,
|
|
128
128
|
children: [
|
|
129
129
|
guard(exampleValue.summary, (summary) => [
|
|
130
|
-
create("
|
|
131
|
-
children:
|
|
130
|
+
create("div", {
|
|
131
|
+
children: `${summary}`,
|
|
132
|
+
className: "openapi-example__summary",
|
|
132
133
|
}),
|
|
133
134
|
]),
|
|
134
135
|
create("ResponseSamples", {
|
|
@@ -143,8 +144,9 @@ export function createResponseExamples(
|
|
|
143
144
|
value: `${exampleName}`,
|
|
144
145
|
children: [
|
|
145
146
|
guard(exampleValue.summary, (summary) => [
|
|
146
|
-
create("
|
|
147
|
-
children:
|
|
147
|
+
create("div", {
|
|
148
|
+
children: `${summary}`,
|
|
149
|
+
className: "openapi-example__summary",
|
|
148
150
|
}),
|
|
149
151
|
]),
|
|
150
152
|
create("ResponseSamples", {
|
|
@@ -171,8 +173,9 @@ export function createResponseExample(responseExample: any, mimeType: string) {
|
|
|
171
173
|
value: `Example`,
|
|
172
174
|
children: [
|
|
173
175
|
guard(responseExample.summary, (summary) => [
|
|
174
|
-
create("
|
|
175
|
-
children:
|
|
176
|
+
create("div", {
|
|
177
|
+
children: `${summary}`,
|
|
178
|
+
className: "openapi-example__summary",
|
|
176
179
|
}),
|
|
177
180
|
]),
|
|
178
181
|
create("ResponseSamples", {
|
|
@@ -187,8 +190,9 @@ export function createResponseExample(responseExample: any, mimeType: string) {
|
|
|
187
190
|
value: `Example`,
|
|
188
191
|
children: [
|
|
189
192
|
guard(responseExample.summary, (summary) => [
|
|
190
|
-
create("
|
|
191
|
-
children:
|
|
193
|
+
create("div", {
|
|
194
|
+
children: `${summary}`,
|
|
195
|
+
className: "openapi-example__summary",
|
|
192
196
|
}),
|
|
193
197
|
]),
|
|
194
198
|
create("ResponseSamples", {
|
package/src/markdown/index.ts
CHANGED
|
@@ -76,7 +76,6 @@ export function createApiPageMD({
|
|
|
76
76
|
`import ResponseSamples from "@theme/ResponseSamples";\n`,
|
|
77
77
|
`import SchemaItem from "@theme/SchemaItem";\n`,
|
|
78
78
|
`import SchemaTabs from "@theme/SchemaTabs";\n`,
|
|
79
|
-
`import Markdown from "@theme/Markdown";\n`,
|
|
80
79
|
`import Heading from "@theme/Heading";\n`,
|
|
81
80
|
`import OperationTabs from "@theme/OperationTabs";\n`,
|
|
82
81
|
`import TabItem from "@theme/TabItem";\n\n`,
|