From 310f5feda0c7dfc0891edcc4c2e19ae21ff34507 Mon Sep 17 00:00:00 2001 From: Josh Burton Date: Thu, 4 Jul 2019 19:13:23 +1200 Subject: [PATCH] [dart-jaguar] Makes converters publicly accessible so they can be used serialization/deserlization outside of the API client (#3245) --- .../src/main/resources/dart-jaguar/apilib.mustache | 6 +++--- .../flutter_petstore/openapi/.openapi-generator/VERSION | 2 +- .../dart-jaguar/flutter_petstore/openapi/README.md | 2 +- .../dart-jaguar/flutter_petstore/openapi/docs/UserApi.md | 4 ++-- .../dart-jaguar/flutter_petstore/openapi/lib/api.dart | 8 ++++---- .../openapi/.openapi-generator/VERSION | 2 +- .../dart-jaguar/flutter_proto_petstore/openapi/README.md | 2 +- .../flutter_proto_petstore/openapi/docs/UserApi.md | 4 ++-- .../flutter_proto_petstore/openapi/lib/api.dart | 8 ++++---- .../dart-jaguar/openapi/.openapi-generator/VERSION | 2 +- samples/client/petstore/dart-jaguar/openapi/README.md | 2 +- .../client/petstore/dart-jaguar/openapi/docs/UserApi.md | 4 ++-- 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 | 2 +- .../petstore/dart-jaguar/openapi_proto/docs/UserApi.md | 4 ++-- .../petstore/dart-jaguar/openapi_proto/lib/api.dart | 8 ++++---- 17 files changed, 35 insertions(+), 35 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 dd78422666ed..cb41c5243ad4 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 converters = { 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 converters = { MimeTypes.json: _jsonJaguarRepo, MimeTypes.binary: _protoJaguarRepo, }; @@ -91,7 +91,7 @@ class JaguarApiGen { base = _baseRoute; } if(converters == null) { - converters = _converters; + converters = this.converters; } 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 06b5019af3f4..479c313e87b9 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.1-SNAPSHOT \ No newline at end of file +4.0.3-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 f69aa4202877..0d0008ed4f4d 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,7 @@ 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-05-27T21:20:43.835+08:00[Asia/Hong_Kong] +- Build date: 2019-06-29T11:26:01.157+12:00[Pacific/Auckland] - Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen ## Requirements diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/docs/UserApi.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/docs/UserApi.md index d525910db9f7..24494bd8757a 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type 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 5d67c1e74120..23e421751572 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 converters = { MimeTypes.json: _jsonJaguarRepo, }; @@ -86,7 +86,7 @@ class JaguarApiGen { base = _baseRoute; } if(converters == null) { - converters = _converters; + converters = this.converters; } return PetApi(base: base, converters: converters, timeout: timeout); } @@ -101,7 +101,7 @@ class JaguarApiGen { base = _baseRoute; } if(converters == null) { - converters = _converters; + converters = this.converters; } return StoreApi(base: base, converters: converters, timeout: timeout); } @@ -116,7 +116,7 @@ class JaguarApiGen { base = _baseRoute; } if(converters == null) { - converters = _converters; + converters = this.converters; } 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 06b5019af3f4..479c313e87b9 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.1-SNAPSHOT \ No newline at end of file +4.0.3-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 a7ea7da6fe97..e50b342433b0 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,7 @@ 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-05-27T21:20:45.456+08:00[Asia/Hong_Kong] +- Build date: 2019-06-29T11:26:04.013+12:00[Pacific/Auckland] - Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen ## Requirements diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/docs/UserApi.md b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/docs/UserApi.md index 3db291415f8d..91cad43d7a11 100644 --- a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type 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 f81210751bee..bed06dd13dc8 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 converters = { MimeTypes.json: _jsonJaguarRepo, MimeTypes.binary: _protoJaguarRepo, }; @@ -96,7 +96,7 @@ class JaguarApiGen { base = _baseRoute; } if(converters == null) { - converters = _converters; + converters = this.converters; } return PetApi(base: base, converters: converters, timeout: timeout); } @@ -111,7 +111,7 @@ class JaguarApiGen { base = _baseRoute; } if(converters == null) { - converters = _converters; + converters = this.converters; } return StoreApi(base: base, converters: converters, timeout: timeout); } @@ -126,7 +126,7 @@ class JaguarApiGen { base = _baseRoute; } if(converters == null) { - converters = _converters; + converters = this.converters; } 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 06b5019af3f4..479c313e87b9 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.1-SNAPSHOT \ No newline at end of file +4.0.3-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 917b232f21ca..2b99d076a709 100644 --- a/samples/client/petstore/dart-jaguar/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/openapi/README.md @@ -4,7 +4,7 @@ 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-05-27T21:20:42.193+08:00[Asia/Hong_Kong] +- Build date: 2019-06-29T11:25:59.502+12:00[Pacific/Auckland] - Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen ## Requirements diff --git a/samples/client/petstore/dart-jaguar/openapi/docs/UserApi.md b/samples/client/petstore/dart-jaguar/openapi/docs/UserApi.md index d525910db9f7..24494bd8757a 100644 --- a/samples/client/petstore/dart-jaguar/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart-jaguar/openapi/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/client/petstore/dart-jaguar/openapi/lib/api.dart b/samples/client/petstore/dart-jaguar/openapi/lib/api.dart index 5d67c1e74120..23e421751572 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 converters = { MimeTypes.json: _jsonJaguarRepo, }; @@ -86,7 +86,7 @@ class JaguarApiGen { base = _baseRoute; } if(converters == null) { - converters = _converters; + converters = this.converters; } return PetApi(base: base, converters: converters, timeout: timeout); } @@ -101,7 +101,7 @@ class JaguarApiGen { base = _baseRoute; } if(converters == null) { - converters = _converters; + converters = this.converters; } return StoreApi(base: base, converters: converters, timeout: timeout); } @@ -116,7 +116,7 @@ class JaguarApiGen { base = _baseRoute; } if(converters == null) { - converters = _converters; + converters = this.converters; } 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 06b5019af3f4..479c313e87b9 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.1-SNAPSHOT \ No newline at end of file +4.0.3-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 310e0d221e8e..761fc689ef7e 100644 --- a/samples/client/petstore/dart-jaguar/openapi_proto/README.md +++ b/samples/client/petstore/dart-jaguar/openapi_proto/README.md @@ -4,7 +4,7 @@ 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-05-27T21:20:47.082+08:00[Asia/Hong_Kong] +- Build date: 2019-06-29T11:26:07.058+12:00[Pacific/Auckland] - Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen ## Requirements diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/docs/UserApi.md b/samples/client/petstore/dart-jaguar/openapi_proto/docs/UserApi.md index 3db291415f8d..91cad43d7a11 100644 --- a/samples/client/petstore/dart-jaguar/openapi_proto/docs/UserApi.md +++ b/samples/client/petstore/dart-jaguar/openapi_proto/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type 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 f81210751bee..bed06dd13dc8 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 converters = { MimeTypes.json: _jsonJaguarRepo, MimeTypes.binary: _protoJaguarRepo, }; @@ -96,7 +96,7 @@ class JaguarApiGen { base = _baseRoute; } if(converters == null) { - converters = _converters; + converters = this.converters; } return PetApi(base: base, converters: converters, timeout: timeout); } @@ -111,7 +111,7 @@ class JaguarApiGen { base = _baseRoute; } if(converters == null) { - converters = _converters; + converters = this.converters; } return StoreApi(base: base, converters: converters, timeout: timeout); } @@ -126,7 +126,7 @@ class JaguarApiGen { base = _baseRoute; } if(converters == null) { - converters = _converters; + converters = this.converters; } return UserApi(base: base, converters: converters, timeout: timeout); }