docusaurus-plugin-openapi-docs 0.0.0-345 → 0.0.0-346

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.
@@ -1,3 +1,3 @@
1
1
  import { ProcessedSidebar } from "@docusaurus/plugin-content-docs/src/sidebars/types";
2
- import type { SidebarOptions, APIOptions, ApiMetadata } from "../types";
3
- export default function generateSidebarSlice(sidebarOptions: SidebarOptions, options: APIOptions, api: ApiMetadata[]): ProcessedSidebar;
2
+ import type { SidebarOptions, ApiOptions, ApiMetadata } from "../types";
3
+ export default function generateSidebarSlice(sidebarOptions: SidebarOptions, options: ApiOptions, api: ApiMetadata[]): ProcessedSidebar;
package/lib/types.d.ts CHANGED
@@ -4,10 +4,10 @@ export type { PropSidebarItemCategory, SidebarItemLink, PropSidebar, PropSidebar
4
4
  export interface PluginOptions {
5
5
  id?: string;
6
6
  config: {
7
- [key: string]: APIOptions;
7
+ [key: string]: ApiOptions;
8
8
  };
9
9
  }
10
- export interface APIOptions {
10
+ export interface ApiOptions {
11
11
  specPath: string;
12
12
  outputDir: string;
13
13
  template?: string;
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-345",
4
+ "version": "0.0.0-346",
5
5
  "license": "MIT",
6
6
  "keywords": [
7
7
  "openapi",
@@ -60,5 +60,5 @@
60
60
  "engines": {
61
61
  "node": ">=14"
62
62
  },
63
- "gitHead": "3c372c894fcdf0e84cbbc0e8e5e4e8e3d770fbb4"
63
+ "gitHead": "c60f384a51dc8579be88e0f35829cf366444f23b"
64
64
  }
@@ -242,7 +242,12 @@ interface Props {
242
242
  }
243
243
 
244
244
  export function createSchemaDetails({ title, body, ...rest }: Props) {
245
- if (body === undefined || body.content === undefined) {
245
+ if (
246
+ body === undefined ||
247
+ body.content === undefined ||
248
+ Object.keys(body).length === 0 ||
249
+ Object.keys(body.content).length === 0
250
+ ) {
246
251
  return undefined;
247
252
  }
248
253
 
@@ -250,7 +255,6 @@ export function createSchemaDetails({ title, body, ...rest }: Props) {
250
255
  // NOTE: We just pick a random content-type.
251
256
  // How common is it to have multiple?
252
257
  const randomFirstKey = Object.keys(body.content)[0];
253
-
254
258
  const firstBody = body.content[randomFirstKey].schema;
255
259
 
256
260
  if (firstBody === undefined) {