docusaurus-plugin-openapi-docs 4.3.5 → 4.3.7

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
@@ -224,10 +224,8 @@ custom_edit_url: null
224
224
  schema: schemaPageGenerator,
225
225
  };
226
226
  loadedApi.map(async (item) => {
227
- if (item.type === "info") {
228
- if (downloadUrl) {
229
- item.downloadUrl = downloadUrl;
230
- }
227
+ if (downloadUrl) {
228
+ item.downloadUrl = downloadUrl;
231
229
  }
232
230
  const markdown = pageGeneratorByType[item.type](item);
233
231
  item.markdown = markdown;
@@ -150,7 +150,7 @@ function createItems(openapiData, options, sidebarOptions) {
150
150
  }
151
151
  // Handle vendor JSON media types
152
152
  const bodyContent = (_o = operationObject.requestBody) === null || _o === void 0 ? void 0 : _o.content;
153
- if (bodyContent) {
153
+ if (bodyContent && Object.keys(bodyContent).length > 0) {
154
154
  const firstBodyContentKey = Object.keys(bodyContent)[0];
155
155
  if (firstBodyContentKey.endsWith("+json")) {
156
156
  const firstBody = bodyContent[firstBodyContentKey];
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": "4.3.5",
4
+ "version": "4.3.7",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -65,5 +65,5 @@
65
65
  "engines": {
66
66
  "node": ">=14"
67
67
  },
68
- "gitHead": "6b5c10430f8ae45faff3a01ca13b485a77d0742a"
68
+ "gitHead": "e4d3ec4ebfb8415e97951076ce2f0901e8d88168"
69
69
  }
package/src/index.ts CHANGED
@@ -315,10 +315,8 @@ custom_edit_url: null
315
315
  };
316
316
 
317
317
  loadedApi.map(async (item) => {
318
- if (item.type === "info") {
319
- if (downloadUrl) {
320
- item.downloadUrl = downloadUrl;
321
- }
318
+ if (downloadUrl) {
319
+ item.downloadUrl = downloadUrl;
322
320
  }
323
321
  const markdown = pageGeneratorByType[item.type](item as any);
324
322
  item.markdown = markdown;
@@ -191,7 +191,8 @@ function createItems(
191
191
 
192
192
  // Handle vendor JSON media types
193
193
  const bodyContent = operationObject.requestBody?.content;
194
- if (bodyContent) {
194
+
195
+ if (bodyContent && Object.keys(bodyContent).length > 0) {
195
196
  const firstBodyContentKey = Object.keys(bodyContent)[0];
196
197
  if (firstBodyContentKey.endsWith("+json")) {
197
198
  const firstBody = bodyContent[firstBodyContentKey];