Skip to content

Commit f53f7c1

Browse files
author
alexperez
committed
chore: add map for additionalPropertiesSchema in _computeJsonObjectValue method in ExampleGenerator.js
1 parent 2866595 commit f53f7c1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/ExampleGenerator.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,9 +1635,17 @@ export class ExampleGenerator extends AmfHelperMixin(Object) {
16351635
_computeJsonObjectValue(range) {
16361636
const pKey = this._getAmfKey(this.ns.w3.shacl.property);
16371637
const properties = this._ensureArray(range[pKey]);
1638+
1639+
const additionalPropertiesKey = this._getAmfKey(this.ns.w3.shacl.additionalPropertiesSchema);
1640+
const additionalProperties = this._ensureArray(range[additionalPropertiesKey]);
1641+
16381642
if (properties && properties.length) {
16391643
return this._jsonExampleFromProperties(properties);
16401644
}
1645+
if (additionalProperties && additionalProperties.length) {
1646+
return this._jsonExampleFromProperties(this._ensureArray(additionalProperties[0][pKey]));
1647+
}
1648+
16411649
return {};
16421650
}
16431651

0 commit comments

Comments
 (0)