forked from loafle/openapi-generator-original
[dart-jaguar] Fixes error accessing default converters (#3361)
`this.converters` was causing errors as the default converters are declared outside of the API client.
This commit is contained in:
parent
1e735c69fa
commit
1aa8a2bec4
@ -21,7 +21,7 @@ import 'package:jaguar_mimetype/jaguar_mimetype.dart';
|
|||||||
final _jsonJaguarRepo = JsonRepo()
|
final _jsonJaguarRepo = JsonRepo()
|
||||||
{{#models}}{{#model}}..add({{classname}}Serializer())
|
{{#models}}{{#model}}..add({{classname}}Serializer())
|
||||||
{{/model}}{{/models}};
|
{{/model}}{{/models}};
|
||||||
final Map<String, CodecRepo> converters = {
|
final Map<String, CodecRepo> defaultConverters = {
|
||||||
MimeTypes.json: _jsonJaguarRepo,
|
MimeTypes.json: _jsonJaguarRepo,
|
||||||
};
|
};
|
||||||
{{/jsonFormat}}
|
{{/jsonFormat}}
|
||||||
@ -33,7 +33,7 @@ final _protoJaguarRepo = ProtoCodecRepo()
|
|||||||
final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true)
|
final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true)
|
||||||
{{#models}}{{#model}}..add((data) => {{classname}}.fromBuffer(List<int>.from(data)))
|
{{#models}}{{#model}}..add((data) => {{classname}}.fromBuffer(List<int>.from(data)))
|
||||||
{{/model}}{{/models}};
|
{{/model}}{{/models}};
|
||||||
final Map<String, CodecRepo> converters = {
|
final Map<String, CodecRepo> defaultConverters = {
|
||||||
MimeTypes.json: _jsonJaguarRepo,
|
MimeTypes.json: _jsonJaguarRepo,
|
||||||
MimeTypes.binary: _protoJaguarRepo,
|
MimeTypes.binary: _protoJaguarRepo,
|
||||||
};
|
};
|
||||||
@ -91,7 +91,7 @@ class {{clientName}} {
|
|||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(converters == null) {
|
if(converters == null) {
|
||||||
converters = this.converters;
|
converters = defaultConverters;
|
||||||
}
|
}
|
||||||
return {{classname}}(base: base, converters: converters, timeout: timeout);
|
return {{classname}}(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
4.0.3-SNAPSHOT
|
4.1.0-SNAPSHOT
|
@ -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:
|
This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project:
|
||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Build date: 2019-06-29T09:47:15.495+12:00[Pacific/Auckland]
|
|
||||||
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
|
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
@ -29,7 +29,7 @@ final _jsonJaguarRepo = JsonRepo()
|
|||||||
..add(TagSerializer())
|
..add(TagSerializer())
|
||||||
..add(UserSerializer())
|
..add(UserSerializer())
|
||||||
;
|
;
|
||||||
final Map<String, CodecRepo> converters = {
|
final Map<String, CodecRepo> defaultConverters = {
|
||||||
MimeTypes.json: _jsonJaguarRepo,
|
MimeTypes.json: _jsonJaguarRepo,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ class Openapi {
|
|||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(converters == null) {
|
if(converters == null) {
|
||||||
converters = this.converters;
|
converters = defaultConverters;
|
||||||
}
|
}
|
||||||
return PetApi(base: base, converters: converters, timeout: timeout);
|
return PetApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
@ -101,7 +101,7 @@ class Openapi {
|
|||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(converters == null) {
|
if(converters == null) {
|
||||||
converters = this.converters;
|
converters = defaultConverters;
|
||||||
}
|
}
|
||||||
return StoreApi(base: base, converters: converters, timeout: timeout);
|
return StoreApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
@ -116,7 +116,7 @@ class Openapi {
|
|||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(converters == null) {
|
if(converters == null) {
|
||||||
converters = this.converters;
|
converters = defaultConverters;
|
||||||
}
|
}
|
||||||
return UserApi(base: base, converters: converters, timeout: timeout);
|
return UserApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
4.0.3-SNAPSHOT
|
4.1.0-SNAPSHOT
|
@ -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:
|
This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project:
|
||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Build date: 2019-06-29T09:47:16.421+12:00[Pacific/Auckland]
|
|
||||||
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
|
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
@ -39,7 +39,7 @@ final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true)
|
|||||||
..add((data) => Tag.fromBuffer(List<int>.from(data)))
|
..add((data) => Tag.fromBuffer(List<int>.from(data)))
|
||||||
..add((data) => User.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.json: _jsonJaguarRepo,
|
||||||
MimeTypes.binary: _protoJaguarRepo,
|
MimeTypes.binary: _protoJaguarRepo,
|
||||||
};
|
};
|
||||||
@ -96,7 +96,7 @@ class Openapi {
|
|||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(converters == null) {
|
if(converters == null) {
|
||||||
converters = this.converters;
|
converters = defaultConverters;
|
||||||
}
|
}
|
||||||
return PetApi(base: base, converters: converters, timeout: timeout);
|
return PetApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ class Openapi {
|
|||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(converters == null) {
|
if(converters == null) {
|
||||||
converters = this.converters;
|
converters = defaultConverters;
|
||||||
}
|
}
|
||||||
return StoreApi(base: base, converters: converters, timeout: timeout);
|
return StoreApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
@ -126,7 +126,7 @@ class Openapi {
|
|||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(converters == null) {
|
if(converters == null) {
|
||||||
converters = this.converters;
|
converters = defaultConverters;
|
||||||
}
|
}
|
||||||
return UserApi(base: base, converters: converters, timeout: timeout);
|
return UserApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
4.0.3-SNAPSHOT
|
4.1.0-SNAPSHOT
|
@ -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:
|
This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project:
|
||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Build date: 2019-06-29T09:47:14.533+12:00[Pacific/Auckland]
|
|
||||||
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
|
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
@ -29,7 +29,7 @@ final _jsonJaguarRepo = JsonRepo()
|
|||||||
..add(TagSerializer())
|
..add(TagSerializer())
|
||||||
..add(UserSerializer())
|
..add(UserSerializer())
|
||||||
;
|
;
|
||||||
final Map<String, CodecRepo> converters = {
|
final Map<String, CodecRepo> defaultConverters = {
|
||||||
MimeTypes.json: _jsonJaguarRepo,
|
MimeTypes.json: _jsonJaguarRepo,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ class Openapi {
|
|||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(converters == null) {
|
if(converters == null) {
|
||||||
converters = this.converters;
|
converters = defaultConverters;
|
||||||
}
|
}
|
||||||
return PetApi(base: base, converters: converters, timeout: timeout);
|
return PetApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
@ -101,7 +101,7 @@ class Openapi {
|
|||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(converters == null) {
|
if(converters == null) {
|
||||||
converters = this.converters;
|
converters = defaultConverters;
|
||||||
}
|
}
|
||||||
return StoreApi(base: base, converters: converters, timeout: timeout);
|
return StoreApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
@ -116,7 +116,7 @@ class Openapi {
|
|||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(converters == null) {
|
if(converters == null) {
|
||||||
converters = this.converters;
|
converters = defaultConverters;
|
||||||
}
|
}
|
||||||
return UserApi(base: base, converters: converters, timeout: timeout);
|
return UserApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
4.0.3-SNAPSHOT
|
4.1.0-SNAPSHOT
|
@ -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:
|
This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project:
|
||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- Build date: 2019-06-29T09:47:17.358+12:00[Pacific/Auckland]
|
|
||||||
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
|
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
@ -39,7 +39,7 @@ final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true)
|
|||||||
..add((data) => Tag.fromBuffer(List<int>.from(data)))
|
..add((data) => Tag.fromBuffer(List<int>.from(data)))
|
||||||
..add((data) => User.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.json: _jsonJaguarRepo,
|
||||||
MimeTypes.binary: _protoJaguarRepo,
|
MimeTypes.binary: _protoJaguarRepo,
|
||||||
};
|
};
|
||||||
@ -96,7 +96,7 @@ class Openapi {
|
|||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(converters == null) {
|
if(converters == null) {
|
||||||
converters = this.converters;
|
converters = defaultConverters;
|
||||||
}
|
}
|
||||||
return PetApi(base: base, converters: converters, timeout: timeout);
|
return PetApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ class Openapi {
|
|||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(converters == null) {
|
if(converters == null) {
|
||||||
converters = this.converters;
|
converters = defaultConverters;
|
||||||
}
|
}
|
||||||
return StoreApi(base: base, converters: converters, timeout: timeout);
|
return StoreApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
@ -126,7 +126,7 @@ class Openapi {
|
|||||||
base = _baseRoute;
|
base = _baseRoute;
|
||||||
}
|
}
|
||||||
if(converters == null) {
|
if(converters == null) {
|
||||||
converters = this.converters;
|
converters = defaultConverters;
|
||||||
}
|
}
|
||||||
return UserApi(base: base, converters: converters, timeout: timeout);
|
return UserApi(base: base, converters: converters, timeout: timeout);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user