Simplify check for defaults and add another test
This commit is contained in:
@@ -8,8 +8,7 @@ import { JsonObject } from "./jsonPathUtils";
|
||||
*/
|
||||
export function generateDefaultValue(schema: JsonSchemaType): JsonValue {
|
||||
if ("default" in schema) {
|
||||
// Ensure we don't return undefined even if schema.default is undefined
|
||||
return schema.default === undefined ? null : schema.default;
|
||||
return schema.default;
|
||||
}
|
||||
|
||||
if (!schema.required) {
|
||||
|
||||
Reference in New Issue
Block a user