Skip to content

Commit 6757900

Browse files
committed
fix defaultValue and cleanup unused code
1 parent c382b79 commit 6757900

File tree

1 file changed

+3
-13
lines changed
  • packages/docusaurus-theme-openapi-docs/src/theme/ParamsItem

1 file changed

+3
-13
lines changed

packages/docusaurus-theme-openapi-docs/src/theme/ParamsItem/index.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,27 +71,17 @@ function ParamsItem({ param, ...rest }: Props) {
7171
} = param;
7272

7373
let schema = param.schema;
74+
let defaultValue: string | undefined;
7475

7576
if (!schema || !schema?.type) {
7677
schema = { type: "any" };
7778
}
78-
79-
let defaultValue: string | undefined;
80-
81-
if (
82-
schema && schema.items
83-
? schema.items.default
84-
: schema
85-
? schema.default
86-
: undefined
87-
) {
88-
}
89-
9079
if (schema) {
9180
if (schema.items) {
9281
defaultValue = schema.items.default;
82+
} else {
83+
defaultValue = schema.default;
9384
}
94-
defaultValue = schema.default;
9585
}
9686

9787
const renderSchemaName = guard(schema, (schema) => (

0 commit comments

Comments
 (0)