diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java index 3cf6c439aea..652ff759deb 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java @@ -58,6 +58,7 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { "String", "bool", "int", + "num", "double") ); instantiationTypes.put("array", "List"); @@ -69,11 +70,12 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { typeMapping.put("List", "List"); typeMapping.put("boolean", "bool"); typeMapping.put("string", "String"); + typeMapping.put("char", "String"); typeMapping.put("int", "int"); - typeMapping.put("float", "double"); typeMapping.put("long", "int"); typeMapping.put("short", "int"); - typeMapping.put("char", "String"); + typeMapping.put("number", "num"); + typeMapping.put("float", "double"); typeMapping.put("double", "double"); typeMapping.put("object", "Object"); typeMapping.put("integer", "int"); diff --git a/samples/client/petstore/dart/swagger/lib/api_client.dart b/samples/client/petstore/dart/swagger/lib/api_client.dart index 9087a80d8cc..73856b69d74 100644 --- a/samples/client/petstore/dart/swagger/lib/api_client.dart +++ b/samples/client/petstore/dart/swagger/lib/api_client.dart @@ -24,8 +24,8 @@ class ApiClient { ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { // Setup authentications (key: authentication name, value: authentication). - _authentications['petstore_auth'] = new OAuth(); _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); + _authentications['petstore_auth'] = new OAuth(); } void addDefaultHeader(String key, String value) {