docusaurus-plugin-openapi-docs 0.0.0-756 → 0.0.0-758

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 CHANGED
@@ -375,6 +375,15 @@ custom_edit_url: null
375
375
  downloadUrl: metadata.downloadUrl,
376
376
  });
377
377
  }
378
+ if (!fs_1.default.existsSync(outputDir)) {
379
+ try {
380
+ fs_1.default.mkdirSync(outputDir, { recursive: true });
381
+ console.log(chalk_1.default.green(`Successfully created "${outputDir}"`));
382
+ }
383
+ catch (err) {
384
+ console.error(chalk_1.default.red(`Failed to create "${outputDir}"`), chalk_1.default.yellow(err));
385
+ }
386
+ }
378
387
  const versionsJson = JSON.stringify(versionsArray, null, 2);
379
388
  try {
380
389
  fs_1.default.writeFileSync(`${outputDir}/versions.json`, versionsJson + "\n", "utf8");
@@ -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 &&
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-756",
4
+ "version": "0.0.0-758",
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": "989b9c8bec0d62a820287b93d3e4d8bc84a5a944"
65
+ "gitHead": "04533fdc0baf6957f997ffcb187f507993163d1b"
66
66
  }
package/src/index.ts CHANGED
@@ -535,6 +535,18 @@ custom_edit_url: null
535
535
  });
536
536
  }
537
537
 
538
+ if (!fs.existsSync(outputDir)) {
539
+ try {
540
+ fs.mkdirSync(outputDir, { recursive: true });
541
+ console.log(chalk.green(`Successfully created "${outputDir}"`));
542
+ } catch (err) {
543
+ console.error(
544
+ chalk.red(`Failed to create "${outputDir}"`),
545
+ chalk.yellow(err)
546
+ );
547
+ }
548
+ }
549
+
538
550
  const versionsJson = JSON.stringify(versionsArray, null, 2);
539
551
  try {
540
552
  fs.writeFileSync(
@@ -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 &&