Skip to content

Commit 3b2c777

Browse files
committed
chore: add extra checks for required property (complex types)
1 parent 3e37ba2 commit 3b2c777

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/schema-parser/schema-parser.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ class SchemaParser {
225225
makeAddRequiredToChildSchema = (parentSchema, childSchema) => {
226226
if (!childSchema) return childSchema;
227227

228-
const required = _.uniq([...(parentSchema.required || []), ...(childSchema.required || [])]);
228+
const required = _.uniq([
229+
...(Array.isArray(parentSchema.required) ? parentSchema.required : []),
230+
...(Array.isArray(childSchema.required) ? childSchema.required : []),
231+
]);
229232

230233
const refData = this.getRefType(childSchema);
231234

0 commit comments

Comments
 (0)