fix number format for dart model

This commit is contained in:
wing328 2016-10-07 00:47:05 +08:00
parent 94cd2cb6a0
commit 574349570a
2 changed files with 5 additions and 3 deletions

View File

@ -58,6 +58,7 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
"String", "String",
"bool", "bool",
"int", "int",
"num",
"double") "double")
); );
instantiationTypes.put("array", "List"); instantiationTypes.put("array", "List");
@ -69,11 +70,12 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
typeMapping.put("List", "List"); typeMapping.put("List", "List");
typeMapping.put("boolean", "bool"); typeMapping.put("boolean", "bool");
typeMapping.put("string", "String"); typeMapping.put("string", "String");
typeMapping.put("char", "String");
typeMapping.put("int", "int"); typeMapping.put("int", "int");
typeMapping.put("float", "double");
typeMapping.put("long", "int"); typeMapping.put("long", "int");
typeMapping.put("short", "int"); typeMapping.put("short", "int");
typeMapping.put("char", "String"); typeMapping.put("number", "num");
typeMapping.put("float", "double");
typeMapping.put("double", "double"); typeMapping.put("double", "double");
typeMapping.put("object", "Object"); typeMapping.put("object", "Object");
typeMapping.put("integer", "int"); typeMapping.put("integer", "int");

View File

@ -24,8 +24,8 @@ class ApiClient {
ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) {
// Setup authentications (key: authentication name, value: authentication). // Setup authentications (key: authentication name, value: authentication).
_authentications['petstore_auth'] = new OAuth();
_authentications['api_key'] = new ApiKeyAuth("header", "api_key"); _authentications['api_key'] = new ApiKeyAuth("header", "api_key");
_authentications['petstore_auth'] = new OAuth();
} }
void addDefaultHeader(String key, String value) { void addDefaultHeader(String key, String value) {