Skip to content

Commit

Permalink
fix defaultValue and cleanup unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
sserrata committed Sep 10, 2024
1 parent c382b79 commit 6757900
Showing 1 changed file with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,17 @@ function ParamsItem({ param, ...rest }: Props) {
} = param;

let schema = param.schema;
let defaultValue: string | undefined;

if (!schema || !schema?.type) {
schema = { type: "any" };
}

let defaultValue: string | undefined;

if (
schema && schema.items
? schema.items.default
: schema
? schema.default
: undefined
) {
}

if (schema) {
if (schema.items) {
defaultValue = schema.items.default;
} else {
defaultValue = schema.default;
}
defaultValue = schema.default;
}

const renderSchemaName = guard(schema, (schema) => (
Expand Down

0 comments on commit 6757900

Please sign in to comment.