docusaurus-plugin-openapi-docs 0.0.0-460 → 0.0.0-462

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
@@ -109,6 +109,7 @@ function pluginOpenAPIDocs(context, options) {
109
109
  ? fs_1.default.readFileSync(template).toString()
110
110
  : `---
111
111
  id: {{{id}}}
112
+ title: "{{{title}}}"
112
113
  description: "{{{description}}}"
113
114
  {{^api}}
114
115
  sidebar_label: Introduction
@@ -138,6 +139,8 @@ info_path: {{{infoPath}}}
138
139
  `;
139
140
  const infoMdTemplate = `---
140
141
  id: {{{id}}}
142
+ title: "{{{title}}}"
143
+ description: "{{{description}}}"
141
144
  sidebar_label: {{{title}}}
142
145
  hide_title: true
143
146
  custom_edit_url: null
@@ -154,7 +157,7 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
154
157
  `;
155
158
  const tagMdTemplate = `---
156
159
  id: {{{id}}}
157
- title: {{{description}}}
160
+ title: "{{{description}}}"
158
161
  description: "{{{description}}}"
159
162
  custom_edit_url: null
160
163
  ---
@@ -193,6 +196,10 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
193
196
  if (item.type === "api") {
194
197
  if (!fs_1.default.existsSync(`${outputDir}/${item.id}.api.mdx`)) {
195
198
  try {
199
+ // kebabCase(arg) returns 0-length string when arg is undefined
200
+ if (item.id.length === 0) {
201
+ throw Error("Operation must have summary or operationId defined");
202
+ }
196
203
  fs_1.default.writeFileSync(`${outputDir}/${item.id}.api.mdx`, view, "utf8");
197
204
  console.log(chalk_1.default.green(`Successfully created "${outputDir}/${item.id}.api.mdx"`));
198
205
  }
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-460",
4
+ "version": "0.0.0-462",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -68,5 +68,5 @@
68
68
  "engines": {
69
69
  "node": ">=14"
70
70
  },
71
- "gitHead": "a17b4695235a05558c0d589c3512e28a86a3ce75"
71
+ "gitHead": "cb520190f1ac4b8dc0d9ce7b1f3732c3ebc5c054"
72
72
  }
package/src/index.ts CHANGED
@@ -143,6 +143,7 @@ export default function pluginOpenAPIDocs(
143
143
  ? fs.readFileSync(template).toString()
144
144
  : `---
145
145
  id: {{{id}}}
146
+ title: "{{{title}}}"
146
147
  description: "{{{description}}}"
147
148
  {{^api}}
148
149
  sidebar_label: Introduction
@@ -173,6 +174,8 @@ info_path: {{{infoPath}}}
173
174
 
174
175
  const infoMdTemplate = `---
175
176
  id: {{{id}}}
177
+ title: "{{{title}}}"
178
+ description: "{{{description}}}"
176
179
  sidebar_label: {{{title}}}
177
180
  hide_title: true
178
181
  custom_edit_url: null
@@ -190,7 +193,7 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
190
193
 
191
194
  const tagMdTemplate = `---
192
195
  id: {{{id}}}
193
- title: {{{description}}}
196
+ title: "{{{description}}}"
194
197
  description: "{{{description}}}"
195
198
  custom_edit_url: null
196
199
  ---
@@ -232,6 +235,12 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
232
235
  if (item.type === "api") {
233
236
  if (!fs.existsSync(`${outputDir}/${item.id}.api.mdx`)) {
234
237
  try {
238
+ // kebabCase(arg) returns 0-length string when arg is undefined
239
+ if (item.id.length === 0) {
240
+ throw Error(
241
+ "Operation must have summary or operationId defined"
242
+ );
243
+ }
235
244
  fs.writeFileSync(`${outputDir}/${item.id}.api.mdx`, view, "utf8");
236
245
  console.log(
237
246
  chalk.green(