Skip to content

Commit 88a0988

Browse files
Merge pull request #60 from advanced-rest-client/fix/W-14278539/example-nulleable-iteration
Fix/w-14278539/example-nulleable-iteration
2 parents fc4a2e3 + 0985b32 commit 88a0988

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@api-components/api-example-generator",
33
"description": "Examples generator from AMF model",
4-
"version": "4.4.24",
4+
"version": "4.4.25",
55
"license": "Apache-2.0",
66
"main": "index.js",
77
"module": "index.js",

src/ExampleGenerator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,7 @@ export class ExampleGenerator extends AmfHelperMixin(Object) {
12781278
let value
12791279
const anyOf = this._ensureArray(range[aKey]);
12801280
if(anyOf){
1281-
for(let anyOfIndex=0; i<anyOf.length; anyOfIndex++) {
1281+
for(let anyOfIndex=0; anyOfIndex<anyOf.length; anyOfIndex++) {
12821282
const exampleValue = this._computeJsonPropertyValue(anyOf[anyOfIndex]);
12831283
if(exampleValue!==null){
12841284
value = exampleValue;

test/ExampleGenerator.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2321,7 +2321,7 @@ describe('ExampleGenerator', () => {
23212321
schema = element._resolve(schema);
23222322
const result = element._computeJsonPropertyValue(schema);
23232323
assert.typeOf(result, 'object');
2324-
assert.deepEqual(result, { messages: [{ "referrers": "", "sequenceId": 1, "text": "", "type": "init", "tz": "", "variables": "" }]})
2324+
assert.deepEqual(result, { messages: [{ "referrers": [{"type": "Salesforce:Core:Bot:Id", "value": ""}], "sequenceId": 1, "text": "", "type": "init", "tz": "", "variables": [] }]})
23252325
});
23262326
});
23272327
});

0 commit comments

Comments
 (0)