From f53f7c17bfc489a68f40c8650c800af0072e0d7a Mon Sep 17 00:00:00 2001 From: alexperez Date: Wed, 31 Jan 2024 17:21:59 -0300 Subject: [PATCH 1/3] chore: add map for additionalPropertiesSchema in _computeJsonObjectValue method in ExampleGenerator.js --- src/ExampleGenerator.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ExampleGenerator.js b/src/ExampleGenerator.js index 3ed8ffd..07f444b 100644 --- a/src/ExampleGenerator.js +++ b/src/ExampleGenerator.js @@ -1635,9 +1635,17 @@ export class ExampleGenerator extends AmfHelperMixin(Object) { _computeJsonObjectValue(range) { const pKey = this._getAmfKey(this.ns.w3.shacl.property); const properties = this._ensureArray(range[pKey]); + + const additionalPropertiesKey = this._getAmfKey(this.ns.w3.shacl.additionalPropertiesSchema); + const additionalProperties = this._ensureArray(range[additionalPropertiesKey]); + if (properties && properties.length) { return this._jsonExampleFromProperties(properties); } + if (additionalProperties && additionalProperties.length) { + return this._jsonExampleFromProperties(this._ensureArray(additionalProperties[0][pKey])); + } + return {}; } From 0d9b6f02dc1978f463161512abb0713aaea028bb Mon Sep 17 00:00:00 2001 From: alexperez Date: Wed, 31 Jan 2024 17:24:35 -0300 Subject: [PATCH 2/3] chore: update @api-components/amf-helper-mixin version to 4.5.24 --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index cf227cf..41ae2d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -271,9 +271,9 @@ } }, "@api-components/amf-helper-mixin": { - "version": "4.5.20", - "resolved": "https://registry.npmjs.org/@api-components/amf-helper-mixin/-/amf-helper-mixin-4.5.20.tgz", - "integrity": "sha512-G/Uvlncl5nkLki4gMIcse9lkNAtEAJKYVJjVvZL/WBET0yS6uS1E1lURLequ9/NizzmjChWxmIGblCjrBeKZTQ==", + "version": "4.5.24", + "resolved": "https://registry.npmjs.org/@api-components/amf-helper-mixin/-/amf-helper-mixin-4.5.24.tgz", + "integrity": "sha512-rxjh+9X4OC0pFbYsqXTmiGTr8JM2xkc/oIyGuW9Ez+CKFcF6tb/7xcog5ZC/9CUQHfa5bFrJ5qXH+wjRyMx3hA==", "requires": { "amf-json-ld-lib": "0.0.14" } diff --git a/package.json b/package.json index 96d2499..7f170ac 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "email": "arc@mulesoft.com" }, "dependencies": { - "@api-components/amf-helper-mixin": "^4.1.8", + "@api-components/amf-helper-mixin": "^4.5.24", "lit-element": "^2.4.0" }, "devDependencies": { From 77fc0fe43ae915200d2e283497271e5abff320c4 Mon Sep 17 00:00:00 2001 From: alexperez Date: Wed, 31 Jan 2024 17:29:51 -0300 Subject: [PATCH 3/3] 4.4.28 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 41ae2d3..12411ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@api-components/api-example-generator", - "version": "4.4.27", + "version": "4.4.28", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7f170ac..217f85e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@api-components/api-example-generator", "description": "Examples generator from AMF model", - "version": "4.4.27", + "version": "4.4.28", "license": "Apache-2.0", "main": "index.js", "module": "index.js",