forked from loafle/openapi-generator-original
Merge pull request #1922 from xhh/javascript-nodejs
[JavaScript] Make JavaScript client work in both Node.js and browser
This commit is contained in:
@@ -133,6 +133,8 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
typeMapping.put("double", "Number");
|
||||
typeMapping.put("number", "Number");
|
||||
typeMapping.put("DateTime", "Date");
|
||||
// binary not supported in JavaScript client right now, using String as a workaround
|
||||
typeMapping.put("binary", "String");
|
||||
|
||||
importMapping.clear();
|
||||
}
|
||||
@@ -205,6 +207,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
|
||||
supportingFiles.add(new SupportingFile("package.mustache", "", "package.json"));
|
||||
supportingFiles.add(new SupportingFile("index.mustache", sourceFolder, "index.js"));
|
||||
supportingFiles.add(new SupportingFile("ApiClient.mustache", sourceFolder, "ApiClient.js"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user