[JavaScript] Add petstore integration test to JS ES6 client (OAS3) (#2245)

* add test for js es6 oas3 client

* fix test with proper done

* add test, fix servers index check
This commit is contained in:
William Cheng
2019-02-27 11:14:51 +08:00
committed by GitHub
parent aa339d6046
commit b5ce0bddee
12 changed files with 362 additions and 10 deletions

View File

@@ -978,13 +978,21 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
hasOptionalParams = true;
}
}
if (operation.servers != null && !operation.servers.isEmpty()) {
// add optional parameter for servers (e.g. index)
hasOptionalParams = true;
}
if (hasOptionalParams) {
argList.add("opts");
}
}
if (!usePromises) {
argList.add("callback");
}
operation.vendorExtensions.put("x-codegen-argList", StringUtils.join(argList, ", "));
operation.vendorExtensions.put("x-codegen-hasOptionalParams", hasOptionalParams);
// Store JSDoc type specification into vendor-extension: x-jsdoc-type.
for (CodegenParameter cp : operation.allParams) {