Skip to content

Commit 7647e56

Browse files
committed
fix: lint
1 parent 250cf11 commit 7647e56

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

  • packages/openapi-code-generator/src/core

packages/openapi-code-generator/src/core/input.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,14 +1098,18 @@ export class SchemaNormalizer {
10981098
* TODO:
10991099
* - doesn't follow allOf / $ref / recurse
11001100
*/
1101-
const properties = it.required.reduce((acc, name) => {
1102-
const fromParent = parent.properties?.[name]
1101+
const properties = it.required.reduce(
1102+
(acc, name) => {
1103+
const fromParent = parent.properties?.[name]
1104+
1105+
if (!acc[name] && fromParent) {
1106+
acc[name] = fromParent
1107+
}
11031108

1104-
if (acc[name] || !fromParent) {
11051109
return acc
1106-
}
1107-
return {...acc, [name]: fromParent}
1108-
}, it.properties ?? {})
1110+
},
1111+
{...it.properties},
1112+
)
11091113

11101114
if (Object.keys(properties).length) {
11111115
return {

0 commit comments

Comments
 (0)