Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
check simple array example value lenght
Browse files Browse the repository at this point in the history
  • Loading branch information
changlong-liu committed Dec 7, 2020
1 parent fc69152 commit f8d503d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/plugins/azgenerator/CodeModelAzImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1992,11 +1992,13 @@ export class CodeModelCliImpl implements CodeModelAz {
example_param.push(new ExampleParam(name, ret, false, KeyValueType.ShorthandSyntax, keys, defaultName, realParam, ancestors, value));
}
else if (this.Parameter_IsSimpleArray(realParam.value)) {
for (let i=0; i<value.length; i++) {
ret += ToJsonString(value[i]) + " ";
if (value.length>0) { // use value only when it's lenght > 0
for (let i=0; i<value.length; i++) {
ret += ToJsonString(value[i]) + " ";
}
ret = ret.trim();
example_param.push(new ExampleParam(name, ret, false, KeyValueType.SimpleArray, [], defaultName, realParam, ancestors, value));
}
ret = ret.trim();
example_param.push(new ExampleParam(name, ret, false, KeyValueType.SimpleArray, [], defaultName, realParam, ancestors, value));
}
else {
for (let i=0; i<value.length; i++) {
Expand Down

0 comments on commit f8d503d

Please sign in to comment.