We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 250cf11 commit 7647e56Copy full SHA for 7647e56
1 file changed
packages/openapi-code-generator/src/core/input.ts
@@ -1098,14 +1098,18 @@ export class SchemaNormalizer {
1098
* TODO:
1099
* - doesn't follow allOf / $ref / recurse
1100
*/
1101
- const properties = it.required.reduce((acc, name) => {
1102
- const fromParent = parent.properties?.[name]
+ const properties = it.required.reduce(
+ (acc, name) => {
1103
+ const fromParent = parent.properties?.[name]
1104
+
1105
+ if (!acc[name] && fromParent) {
1106
+ acc[name] = fromParent
1107
+ }
1108
- if (acc[name] || !fromParent) {
1109
return acc
- }
- return {...acc, [name]: fromParent}
- }, it.properties ?? {})
1110
+ },
1111
+ {...it.properties},
1112
+ )
1113
1114
if (Object.keys(properties).length) {
1115
return {
0 commit comments