Skip to content

Commit 310f5fe

Browse files
josh-burtonwing328
authored andcommitted
[dart-jaguar] Makes converters publicly accessible so they can be used serialization/deserlization outside of the API client (#3245)
1 parent 0cb9212 commit 310f5fe

File tree

17 files changed

+35
-35
lines changed

17 files changed

+35
-35
lines changed

modules/openapi-generator/src/main/resources/dart-jaguar/apilib.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import 'package:jaguar_mimetype/jaguar_mimetype.dart';
2121
final _jsonJaguarRepo = JsonRepo()
2222
{{#models}}{{#model}}..add({{classname}}Serializer())
2323
{{/model}}{{/models}};
24-
final Map<String, CodecRepo> _converters = {
24+
final Map<String, CodecRepo> converters = {
2525
MimeTypes.json: _jsonJaguarRepo,
2626
};
2727
{{/jsonFormat}}
@@ -33,7 +33,7 @@ final _protoJaguarRepo = ProtoCodecRepo()
3333
final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true)
3434
{{#models}}{{#model}}..add((data) => {{classname}}.fromBuffer(List<int>.from(data)))
3535
{{/model}}{{/models}};
36-
final Map<String, CodecRepo> _converters = {
36+
final Map<String, CodecRepo> converters = {
3737
MimeTypes.json: _jsonJaguarRepo,
3838
MimeTypes.binary: _protoJaguarRepo,
3939
};
@@ -91,7 +91,7 @@ class JaguarApiGen {
9191
base = _baseRoute;
9292
}
9393
if(converters == null) {
94-
converters = _converters;
94+
converters = this.converters;
9595
}
9696
return {{classname}}(base: base, converters: converters, timeout: timeout);
9797
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.1-SNAPSHOT
1+
4.0.3-SNAPSHOT

samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api ke
44
This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project:
55

66
- API version: 1.0.0
7-
- Build date: 2019-05-27T21:20:43.835+08:00[Asia/Hong_Kong]
7+
- Build date: 2019-06-29T11:26:01.157+12:00[Pacific/Auckland]
88
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
99

1010
## Requirements

samples/client/petstore/dart-jaguar/flutter_petstore/openapi/docs/UserApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ try {
8484

8585
Name | Type | Description | Notes
8686
------------- | ------------- | ------------- | -------------
87-
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
87+
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
8888

8989
### Return type
9090

@@ -124,7 +124,7 @@ try {
124124

125125
Name | Type | Description | Notes
126126
------------- | ------------- | ------------- | -------------
127-
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
127+
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
128128

129129
### Return type
130130

samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final _jsonJaguarRepo = JsonRepo()
2929
..add(TagSerializer())
3030
..add(UserSerializer())
3131
;
32-
final Map<String, CodecRepo> _converters = {
32+
final Map<String, CodecRepo> converters = {
3333
MimeTypes.json: _jsonJaguarRepo,
3434
};
3535

@@ -86,7 +86,7 @@ class JaguarApiGen {
8686
base = _baseRoute;
8787
}
8888
if(converters == null) {
89-
converters = _converters;
89+
converters = this.converters;
9090
}
9191
return PetApi(base: base, converters: converters, timeout: timeout);
9292
}
@@ -101,7 +101,7 @@ class JaguarApiGen {
101101
base = _baseRoute;
102102
}
103103
if(converters == null) {
104-
converters = _converters;
104+
converters = this.converters;
105105
}
106106
return StoreApi(base: base, converters: converters, timeout: timeout);
107107
}
@@ -116,7 +116,7 @@ class JaguarApiGen {
116116
base = _baseRoute;
117117
}
118118
if(converters == null) {
119-
converters = _converters;
119+
converters = this.converters;
120120
}
121121
return UserApi(base: base, converters: converters, timeout: timeout);
122122
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.1-SNAPSHOT
1+
4.0.3-SNAPSHOT

samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api ke
44
This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project:
55

66
- API version: 1.0.0
7-
- Build date: 2019-05-27T21:20:45.456+08:00[Asia/Hong_Kong]
7+
- Build date: 2019-06-29T11:26:04.013+12:00[Pacific/Auckland]
88
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
99

1010
## Requirements

samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/docs/UserApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ try {
8484

8585
Name | Type | Description | Notes
8686
------------- | ------------- | ------------- | -------------
87-
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
87+
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
8888

8989
### Return type
9090

@@ -124,7 +124,7 @@ try {
124124

125125
Name | Type | Description | Notes
126126
------------- | ------------- | ------------- | -------------
127-
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
127+
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
128128

129129
### Return type
130130

samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/lib/api.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true)
3939
..add((data) => Tag.fromBuffer(List<int>.from(data)))
4040
..add((data) => User.fromBuffer(List<int>.from(data)))
4141
;
42-
final Map<String, CodecRepo> _converters = {
42+
final Map<String, CodecRepo> converters = {
4343
MimeTypes.json: _jsonJaguarRepo,
4444
MimeTypes.binary: _protoJaguarRepo,
4545
};
@@ -96,7 +96,7 @@ class JaguarApiGen {
9696
base = _baseRoute;
9797
}
9898
if(converters == null) {
99-
converters = _converters;
99+
converters = this.converters;
100100
}
101101
return PetApi(base: base, converters: converters, timeout: timeout);
102102
}
@@ -111,7 +111,7 @@ class JaguarApiGen {
111111
base = _baseRoute;
112112
}
113113
if(converters == null) {
114-
converters = _converters;
114+
converters = this.converters;
115115
}
116116
return StoreApi(base: base, converters: converters, timeout: timeout);
117117
}
@@ -126,7 +126,7 @@ class JaguarApiGen {
126126
base = _baseRoute;
127127
}
128128
if(converters == null) {
129-
converters = _converters;
129+
converters = this.converters;
130130
}
131131
return UserApi(base: base, converters: converters, timeout: timeout);
132132
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.1-SNAPSHOT
1+
4.0.3-SNAPSHOT

samples/client/petstore/dart-jaguar/openapi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api ke
44
This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project:
55

66
- API version: 1.0.0
7-
- Build date: 2019-05-27T21:20:42.193+08:00[Asia/Hong_Kong]
7+
- Build date: 2019-06-29T11:25:59.502+12:00[Pacific/Auckland]
88
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
99

1010
## Requirements

samples/client/petstore/dart-jaguar/openapi/docs/UserApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ try {
8484

8585
Name | Type | Description | Notes
8686
------------- | ------------- | ------------- | -------------
87-
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
87+
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
8888

8989
### Return type
9090

@@ -124,7 +124,7 @@ try {
124124

125125
Name | Type | Description | Notes
126126
------------- | ------------- | ------------- | -------------
127-
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
127+
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
128128

129129
### Return type
130130

samples/client/petstore/dart-jaguar/openapi/lib/api.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final _jsonJaguarRepo = JsonRepo()
2929
..add(TagSerializer())
3030
..add(UserSerializer())
3131
;
32-
final Map<String, CodecRepo> _converters = {
32+
final Map<String, CodecRepo> converters = {
3333
MimeTypes.json: _jsonJaguarRepo,
3434
};
3535

@@ -86,7 +86,7 @@ class JaguarApiGen {
8686
base = _baseRoute;
8787
}
8888
if(converters == null) {
89-
converters = _converters;
89+
converters = this.converters;
9090
}
9191
return PetApi(base: base, converters: converters, timeout: timeout);
9292
}
@@ -101,7 +101,7 @@ class JaguarApiGen {
101101
base = _baseRoute;
102102
}
103103
if(converters == null) {
104-
converters = _converters;
104+
converters = this.converters;
105105
}
106106
return StoreApi(base: base, converters: converters, timeout: timeout);
107107
}
@@ -116,7 +116,7 @@ class JaguarApiGen {
116116
base = _baseRoute;
117117
}
118118
if(converters == null) {
119-
converters = _converters;
119+
converters = this.converters;
120120
}
121121
return UserApi(base: base, converters: converters, timeout: timeout);
122122
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.1-SNAPSHOT
1+
4.0.3-SNAPSHOT

samples/client/petstore/dart-jaguar/openapi_proto/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api ke
44
This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project:
55

66
- API version: 1.0.0
7-
- Build date: 2019-05-27T21:20:47.082+08:00[Asia/Hong_Kong]
7+
- Build date: 2019-06-29T11:26:07.058+12:00[Pacific/Auckland]
88
- Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen
99

1010
## Requirements

samples/client/petstore/dart-jaguar/openapi_proto/docs/UserApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ try {
8484

8585
Name | Type | Description | Notes
8686
------------- | ------------- | ------------- | -------------
87-
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
87+
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
8888

8989
### Return type
9090

@@ -124,7 +124,7 @@ try {
124124

125125
Name | Type | Description | Notes
126126
------------- | ------------- | ------------- | -------------
127-
**body** | [**List&lt;User&gt;**](List.md)| List of user object |
127+
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
128128

129129
### Return type
130130

samples/client/petstore/dart-jaguar/openapi_proto/lib/api.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final _jsonJaguarRepo = ProtoCodecRepo(isJsonFormatEnabled: true)
3939
..add((data) => Tag.fromBuffer(List<int>.from(data)))
4040
..add((data) => User.fromBuffer(List<int>.from(data)))
4141
;
42-
final Map<String, CodecRepo> _converters = {
42+
final Map<String, CodecRepo> converters = {
4343
MimeTypes.json: _jsonJaguarRepo,
4444
MimeTypes.binary: _protoJaguarRepo,
4545
};
@@ -96,7 +96,7 @@ class JaguarApiGen {
9696
base = _baseRoute;
9797
}
9898
if(converters == null) {
99-
converters = _converters;
99+
converters = this.converters;
100100
}
101101
return PetApi(base: base, converters: converters, timeout: timeout);
102102
}
@@ -111,7 +111,7 @@ class JaguarApiGen {
111111
base = _baseRoute;
112112
}
113113
if(converters == null) {
114-
converters = _converters;
114+
converters = this.converters;
115115
}
116116
return StoreApi(base: base, converters: converters, timeout: timeout);
117117
}
@@ -126,7 +126,7 @@ class JaguarApiGen {
126126
base = _baseRoute;
127127
}
128128
if(converters == null) {
129-
converters = _converters;
129+
converters = this.converters;
130130
}
131131
return UserApi(base: base, converters: converters, timeout: timeout);
132132
}

0 commit comments

Comments
 (0)