Fixed: if not given cannnot be null default
This commit is contained in:
parent
bbe4924c88
commit
b9c58252a1
1 changed files with 1 additions and 1 deletions
|
|
@ -13,7 +13,7 @@ export function generateDefaultValue(schema: JsonSchemaType): JsonValue {
|
||||||
if (!schema.required) {
|
if (!schema.required) {
|
||||||
if (schema.type === "array") return [];
|
if (schema.type === "array") return [];
|
||||||
if (schema.type === "object") return {};
|
if (schema.type === "object") return {};
|
||||||
return null;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (schema.type) {
|
switch (schema.type) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue