Skip to content

Commit 76fd6d1

Browse files
authored
docs: fix required properties marked as optional in OAS with allOf schemas (#14062)
1 parent 20892ae commit 76fd6d1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

www/apps/api-reference/utils/merge-all-of-types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,16 @@ export default function mergeAllOfTypes(
2626
return allOfSchema.allOf[0]
2727
}
2828

29+
const required = allOfSchema.allOf.reduce<string[]>((acc, item) => {
30+
if (item.required) {
31+
acc.push(...item.required)
32+
}
33+
return acc
34+
}, [])
35+
2936
return {
3037
type: "object",
3138
properties,
39+
required: [...new Set(required)],
3240
}
3341
}

0 commit comments

Comments
 (0)