Skip to content

Commit 9e00de9

Browse files
committed
fix(ExampleGenerator): generate example from both allOf and properties info
1 parent 9a007bb commit 9e00de9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ExampleGenerator.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,13 @@ export class ExampleGenerator extends AmfHelperMixin(Object) {
15251525
}
15261526
}
15271527
}
1528+
const properties = this._ensureArray(range[pKey])
1529+
if (properties) {
1530+
const propertiesExamples = this._jsonExampleFromProperties(properties)
1531+
if (propertiesExamples && typeof propertiesExamples === 'object') {
1532+
examples.push(propertiesExamples);
1533+
}
1534+
}
15281535
return examples.reduce((acc, value) => ({...acc, ...value}), {});
15291536
}
15301537

0 commit comments

Comments
 (0)