Skip to content

Commit

Permalink
[dart-jaguar] Fixes error accessing default converters (OpenAPITools#…
Browse files Browse the repository at this point in the history
…3361)

`this.converters` was causing errors as the default converters are declared outside of the API client.
  • Loading branch information
josh-burton authored and wing328 committed Jul 18, 2019
1 parent 1e735c6 commit 1aa8a2b
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import 'package:jaguar_mimetype/jaguar_mimetype.dart';
final _jsonJaguarRepo = JsonRepo()
{{#models}}{{#model}}..add({{classname}}Serializer())
{{/model}}{{/models}};
final Map<String, CodecRepo> converters = {
final Map<String, CodecRepo> defaultConverters = {
MimeTypes.json: _jsonJaguarRepo,
};
{{/jsonFormat}}
Expand All @@ -33,7 +33,7 @@ final _protoJaguarRepo = ProtoCodecRepo()
final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true)
{{#models}}{{#model}}..add((data) => {{classname}}.fromBuffer(List<int>.from(data)))
{{/model}}{{/models}};
final Map<String, CodecRepo> converters = {
final Map<String, CodecRepo> defaultConverters = {
MimeTypes.json: _jsonJaguarRepo,
MimeTypes.binary: _protoJaguarRepo,
};
Expand Down Expand Up @@ -91,7 +91,7 @@ class {{clientName}} {
base = _baseRoute;
}
if(converters == null) {
converters = this.converters;
converters = defaultConverters;
}
return {{classname}}(base: base, converters: converters, timeout: timeout);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.3-SNAPSHOT
4.1.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final _jsonJaguarRepo = JsonRepo()
..add(TagSerializer())
..add(UserSerializer())
;
final Map<String, CodecRepo> converters = {
final Map<String, CodecRepo> defaultConverters = {
MimeTypes.json: _jsonJaguarRepo,
};

Expand Down Expand Up @@ -86,7 +86,7 @@ class Openapi {
base = _baseRoute;
}
if(converters == null) {
converters = this.converters;
converters = defaultConverters;
}
return PetApi(base: base, converters: converters, timeout: timeout);
}
Expand All @@ -101,7 +101,7 @@ class Openapi {
base = _baseRoute;
}
if(converters == null) {
converters = this.converters;
converters = defaultConverters;
}
return StoreApi(base: base, converters: converters, timeout: timeout);
}
Expand All @@ -116,7 +116,7 @@ class Openapi {
base = _baseRoute;
}
if(converters == null) {
converters = this.converters;
converters = defaultConverters;
}
return UserApi(base: base, converters: converters, timeout: timeout);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.3-SNAPSHOT
4.1.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true)
..add((data) => Tag.fromBuffer(List<int>.from(data)))
..add((data) => User.fromBuffer(List<int>.from(data)))
;
final Map<String, CodecRepo> converters = {
final Map<String, CodecRepo> defaultConverters = {
MimeTypes.json: _jsonJaguarRepo,
MimeTypes.binary: _protoJaguarRepo,
};
Expand Down Expand Up @@ -96,7 +96,7 @@ class Openapi {
base = _baseRoute;
}
if(converters == null) {
converters = this.converters;
converters = defaultConverters;
}
return PetApi(base: base, converters: converters, timeout: timeout);
}
Expand All @@ -111,7 +111,7 @@ class Openapi {
base = _baseRoute;
}
if(converters == null) {
converters = this.converters;
converters = defaultConverters;
}
return StoreApi(base: base, converters: converters, timeout: timeout);
}
Expand All @@ -126,7 +126,7 @@ class Openapi {
base = _baseRoute;
}
if(converters == null) {
converters = this.converters;
converters = defaultConverters;
}
return UserApi(base: base, converters: converters, timeout: timeout);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.3-SNAPSHOT
4.1.0-SNAPSHOT
1 change: 0 additions & 1 deletion samples/client/petstore/dart-jaguar/openapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions samples/client/petstore/dart-jaguar/openapi/lib/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final _jsonJaguarRepo = JsonRepo()
..add(TagSerializer())
..add(UserSerializer())
;
final Map<String, CodecRepo> converters = {
final Map<String, CodecRepo> defaultConverters = {
MimeTypes.json: _jsonJaguarRepo,
};

Expand Down Expand Up @@ -86,7 +86,7 @@ class Openapi {
base = _baseRoute;
}
if(converters == null) {
converters = this.converters;
converters = defaultConverters;
}
return PetApi(base: base, converters: converters, timeout: timeout);
}
Expand All @@ -101,7 +101,7 @@ class Openapi {
base = _baseRoute;
}
if(converters == null) {
converters = this.converters;
converters = defaultConverters;
}
return StoreApi(base: base, converters: converters, timeout: timeout);
}
Expand All @@ -116,7 +116,7 @@ class Openapi {
base = _baseRoute;
}
if(converters == null) {
converters = this.converters;
converters = defaultConverters;
}
return UserApi(base: base, converters: converters, timeout: timeout);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.3-SNAPSHOT
4.1.0-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true)
..add((data) => Tag.fromBuffer(List<int>.from(data)))
..add((data) => User.fromBuffer(List<int>.from(data)))
;
final Map<String, CodecRepo> converters = {
final Map<String, CodecRepo> defaultConverters = {
MimeTypes.json: _jsonJaguarRepo,
MimeTypes.binary: _protoJaguarRepo,
};
Expand Down Expand Up @@ -96,7 +96,7 @@ class Openapi {
base = _baseRoute;
}
if(converters == null) {
converters = this.converters;
converters = defaultConverters;
}
return PetApi(base: base, converters: converters, timeout: timeout);
}
Expand All @@ -111,7 +111,7 @@ class Openapi {
base = _baseRoute;
}
if(converters == null) {
converters = this.converters;
converters = defaultConverters;
}
return StoreApi(base: base, converters: converters, timeout: timeout);
}
Expand All @@ -126,7 +126,7 @@ class Openapi {
base = _baseRoute;
}
if(converters == null) {
converters = this.converters;
converters = defaultConverters;
}
return UserApi(base: base, converters: converters, timeout: timeout);
}
Expand Down

0 comments on commit 1aa8a2b

Please sign in to comment.