forked from loafle/openapi-generator-original
Make JavaScript client work in both Node.js and browser
* Replace jQuery with SuperAgent which works in both Node.js and browser * Use UMD pattern (returnExports.js) to make the module exporting compatible with all major systems: AMD, Node.js (CommonJS) and browser * Implement support of header and form parameters. Closes #1736 * Move HTTP requesting code to `ApiClient` and allow customizing options in it, e.g. "basePath" * Update unit tests accordingly and add some tests for `ApiClient`
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 Object as a workaround
|
||||
typeMapping.put("binary", "Object");
|
||||
|
||||
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