Update client/src/utils/schemaUtils.ts
Co-authored-by: Cliff Hall <cliff@futurescale.com>
This commit is contained in:
parent
51eb7cf849
commit
cf2778ad19
1 changed files with 2 additions and 2 deletions
|
|
@ -113,13 +113,13 @@ export function generateDefaultValue(
|
|||
const obj: JsonObject = {};
|
||||
// Only include properties that are required according to the schema's required array
|
||||
Object.entries(schema.properties).forEach(([key, prop]) => {
|
||||
const isPropertyRequired = schema.required?.includes(key) ?? false;
|
||||
if (isPropertyRequired) {
|
||||
if (isPropertyRequired(key, schema)) {
|
||||
const value = generateDefaultValue(prop, key, schema);
|
||||
if (value !== undefined) {
|
||||
obj[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
return obj;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue