Skip to content

Commit cf2778a

Browse files
olaservocliffhall
andauthored
Update client/src/utils/schemaUtils.ts
Co-authored-by: Cliff Hall <[email protected]>
1 parent 51eb7cf commit cf2778a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/src/utils/schemaUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ export function generateDefaultValue(
113113
const obj: JsonObject = {};
114114
// Only include properties that are required according to the schema's required array
115115
Object.entries(schema.properties).forEach(([key, prop]) => {
116-
const isPropertyRequired = schema.required?.includes(key) ?? false;
117-
if (isPropertyRequired) {
116+
if (isPropertyRequired(key, schema)) {
118117
const value = generateDefaultValue(prop, key, schema);
119118
if (value !== undefined) {
120119
obj[key] = value;
121120
}
122121
}
122+
123123
});
124124
return obj;
125125
}

0 commit comments

Comments
 (0)