From 1aa8a2bec4c6f49626f58db96cb44e38a9b886e9 Mon Sep 17 00:00:00 2001 From: Josh Burton Date: Thu, 18 Jul 2019 18:28:15 +1200 Subject: [PATCH] [dart-jaguar] Fixes error accessing default converters (#3361) `this.converters` was causing errors as the default converters are declared outside of the API client. --- .../src/main/resources/dart-jaguar/apilib.mustache | 6 +++--- .../flutter_petstore/openapi/.openapi-generator/VERSION | 2 +- .../dart-jaguar/flutter_petstore/openapi/README.md | 1 - .../dart-jaguar/flutter_petstore/openapi/lib/api.dart | 8 ++++---- .../openapi/.openapi-generator/VERSION | 2 +- .../dart-jaguar/flutter_proto_petstore/openapi/README.md | 1 - .../flutter_proto_petstore/openapi/lib/api.dart | 8 ++++---- .../dart-jaguar/openapi/.openapi-generator/VERSION | 2 +- samples/client/petstore/dart-jaguar/openapi/README.md | 1 - samples/client/petstore/dart-jaguar/openapi/lib/api.dart | 8 ++++---- .../dart-jaguar/openapi_proto/.openapi-generator/VERSION | 2 +- .../client/petstore/dart-jaguar/openapi_proto/README.md | 1 - .../petstore/dart-jaguar/openapi_proto/lib/api.dart | 8 ++++---- 13 files changed, 23 insertions(+), 27 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/apilib.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/apilib.mustache index 8571ea0a198..1fd657ea1df 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/apilib.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/apilib.mustache @@ -21,7 +21,7 @@ import 'package:jaguar_mimetype/jaguar_mimetype.dart'; final _jsonJaguarRepo = JsonRepo() {{#models}}{{#model}}..add({{classname}}Serializer()) {{/model}}{{/models}}; -final Map converters = { +final Map defaultConverters = { MimeTypes.json: _jsonJaguarRepo, }; {{/jsonFormat}} @@ -33,7 +33,7 @@ final _protoJaguarRepo = ProtoCodecRepo() final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true) {{#models}}{{#model}}..add((data) => {{classname}}.fromBuffer(List.from(data))) {{/model}}{{/models}}; -final Map converters = { +final Map defaultConverters = { MimeTypes.json: _jsonJaguarRepo, MimeTypes.binary: _protoJaguarRepo, }; @@ -91,7 +91,7 @@ class {{clientName}} { base = _baseRoute; } if(converters == null) { - converters = this.converters; + converters = defaultConverters; } return {{classname}}(base: base, converters: converters, timeout: timeout); } diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/VERSION index 479c313e87b..83a328a9227 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md index 291b60d7e6b..693df464eb0 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md @@ -4,7 +4,6 @@ This is a sample server Petstore server. For this sample, you can use the api ke This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: - API version: 1.0.0 -- Build date: 2019-06-29T09:47:15.495+12:00[Pacific/Auckland] - Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen ## Requirements diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api.dart index b787b0405de..d077b86fe99 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api.dart +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api.dart @@ -29,7 +29,7 @@ final _jsonJaguarRepo = JsonRepo() ..add(TagSerializer()) ..add(UserSerializer()) ; -final Map converters = { +final Map defaultConverters = { MimeTypes.json: _jsonJaguarRepo, }; @@ -86,7 +86,7 @@ class Openapi { base = _baseRoute; } if(converters == null) { - converters = this.converters; + converters = defaultConverters; } return PetApi(base: base, converters: converters, timeout: timeout); } @@ -101,7 +101,7 @@ class Openapi { base = _baseRoute; } if(converters == null) { - converters = this.converters; + converters = defaultConverters; } return StoreApi(base: base, converters: converters, timeout: timeout); } @@ -116,7 +116,7 @@ class Openapi { base = _baseRoute; } if(converters == null) { - converters = this.converters; + converters = defaultConverters; } return UserApi(base: base, converters: converters, timeout: timeout); } diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/VERSION index 479c313e87b..83a328a9227 100644 --- a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md index 82778678423..693df464eb0 100644 --- a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md @@ -4,7 +4,6 @@ This is a sample server Petstore server. For this sample, you can use the api ke This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: - API version: 1.0.0 -- Build date: 2019-06-29T09:47:16.421+12:00[Pacific/Auckland] - Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen ## Requirements diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api.dart b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api.dart index 12dcdff72fe..60148b8f584 100644 --- a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api.dart +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api.dart @@ -39,7 +39,7 @@ final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true) ..add((data) => Tag.fromBuffer(List.from(data))) ..add((data) => User.fromBuffer(List.from(data))) ; -final Map converters = { +final Map defaultConverters = { MimeTypes.json: _jsonJaguarRepo, MimeTypes.binary: _protoJaguarRepo, }; @@ -96,7 +96,7 @@ class Openapi { base = _baseRoute; } if(converters == null) { - converters = this.converters; + converters = defaultConverters; } return PetApi(base: base, converters: converters, timeout: timeout); } @@ -111,7 +111,7 @@ class Openapi { base = _baseRoute; } if(converters == null) { - converters = this.converters; + converters = defaultConverters; } return StoreApi(base: base, converters: converters, timeout: timeout); } @@ -126,7 +126,7 @@ class Openapi { base = _baseRoute; } if(converters == null) { - converters = this.converters; + converters = defaultConverters; } return UserApi(base: base, converters: converters, timeout: timeout); } diff --git a/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION index 479c313e87b..83a328a9227 100644 --- a/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/openapi/README.md b/samples/client/petstore/dart-jaguar/openapi/README.md index 7f450643330..693df464eb0 100644 --- a/samples/client/petstore/dart-jaguar/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/openapi/README.md @@ -4,7 +4,6 @@ This is a sample server Petstore server. For this sample, you can use the api ke This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: - API version: 1.0.0 -- Build date: 2019-06-29T09:47:14.533+12:00[Pacific/Auckland] - Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen ## Requirements diff --git a/samples/client/petstore/dart-jaguar/openapi/lib/api.dart b/samples/client/petstore/dart-jaguar/openapi/lib/api.dart index b787b0405de..d077b86fe99 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/api.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/api.dart @@ -29,7 +29,7 @@ final _jsonJaguarRepo = JsonRepo() ..add(TagSerializer()) ..add(UserSerializer()) ; -final Map converters = { +final Map defaultConverters = { MimeTypes.json: _jsonJaguarRepo, }; @@ -86,7 +86,7 @@ class Openapi { base = _baseRoute; } if(converters == null) { - converters = this.converters; + converters = defaultConverters; } return PetApi(base: base, converters: converters, timeout: timeout); } @@ -101,7 +101,7 @@ class Openapi { base = _baseRoute; } if(converters == null) { - converters = this.converters; + converters = defaultConverters; } return StoreApi(base: base, converters: converters, timeout: timeout); } @@ -116,7 +116,7 @@ class Openapi { base = _baseRoute; } if(converters == null) { - converters = this.converters; + converters = defaultConverters; } return UserApi(base: base, converters: converters, timeout: timeout); } diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/VERSION b/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/VERSION index 479c313e87b..83a328a9227 100644 --- a/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.3-SNAPSHOT \ No newline at end of file +4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/README.md b/samples/client/petstore/dart-jaguar/openapi_proto/README.md index 84be8a47c9f..693df464eb0 100644 --- a/samples/client/petstore/dart-jaguar/openapi_proto/README.md +++ b/samples/client/petstore/dart-jaguar/openapi_proto/README.md @@ -4,7 +4,6 @@ This is a sample server Petstore server. For this sample, you can use the api ke This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: - API version: 1.0.0 -- Build date: 2019-06-29T09:47:17.358+12:00[Pacific/Auckland] - Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen ## Requirements diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/lib/api.dart b/samples/client/petstore/dart-jaguar/openapi_proto/lib/api.dart index 12dcdff72fe..60148b8f584 100644 --- a/samples/client/petstore/dart-jaguar/openapi_proto/lib/api.dart +++ b/samples/client/petstore/dart-jaguar/openapi_proto/lib/api.dart @@ -39,7 +39,7 @@ final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true) ..add((data) => Tag.fromBuffer(List.from(data))) ..add((data) => User.fromBuffer(List.from(data))) ; -final Map converters = { +final Map defaultConverters = { MimeTypes.json: _jsonJaguarRepo, MimeTypes.binary: _protoJaguarRepo, }; @@ -96,7 +96,7 @@ class Openapi { base = _baseRoute; } if(converters == null) { - converters = this.converters; + converters = defaultConverters; } return PetApi(base: base, converters: converters, timeout: timeout); } @@ -111,7 +111,7 @@ class Openapi { base = _baseRoute; } if(converters == null) { - converters = this.converters; + converters = defaultConverters; } return StoreApi(base: base, converters: converters, timeout: timeout); } @@ -126,7 +126,7 @@ class Openapi { base = _baseRoute; } if(converters == null) { - converters = this.converters; + converters = defaultConverters; } return UserApi(base: base, converters: converters, timeout: timeout); }