diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache index 8887881dc355..f3e63b485e17 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache @@ -3,7 +3,7 @@ {{{appDescription}}} {{/appDescription}} -This Dart package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: +This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: - API version: {{appVersion}} {{#artifactVersion}} @@ -82,8 +82,8 @@ import 'package:{{pubName}}/api.dart'; {{/authMethods}} {{/hasAuthMethods}} -final swaggerGen = SwaggerGen(); -var api_instance = swaggerGen.get{{classname}}(); +final jaguarApiGen = JaguarApiGen(); +var api_instance = jaguarApiGen.get{{classname}}(); {{#allParams}} var {{paramName}} = {{#isListContainer}}[{{/isListContainer}}{{#isBodyParam}}new {{dataType}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isListContainer}}]{{/isListContainer}}; // {{{dataType}}} | {{{description}}} {{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache index 49d560fda8cb..762cb6a0fb11 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache @@ -25,7 +25,7 @@ class {{classname}} extends _${{classname}}Client implements ApiClient { @{{httpMethod}}Req(path: "{{path}}"{{#hasAuthMethods}}, metadata: {"auth": [{{#authMethods}} {"type": "{{type}}", "name": "{{name}}"{{#isApiKey}}, "keyName": "{{keyParamName}}", "where": "{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}"{{/isApiKey}} }{{#hasMore}}, {{/hasMore}}{{/authMethods}}]}{{/hasAuthMethods}}) Future<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{nickname}}( {{#pathParams}} - {{dataType}} {{paramName}}{{#hasMore}}, {{/hasMore}} + @PathParam("{{baseName}}") {{dataType}} {{paramName}}{{#hasMore}}, {{/hasMore}} {{/pathParams}} {{#headerParams}} {{#-first}}{{#hasPathParams}},{{/hasPathParams}}{{/-first}} 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 1696d1ac2d25..71cfe8618a20 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/apilib.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/apilib.mustache @@ -18,16 +18,16 @@ final jsonJaguarRepo = JsonRepo() final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()]; -class SwaggerGen { +class JaguarApiGen { List interceptors; - String baseSwaggerPath = "{{basePath}}"; + String basePath = "{{basePath}}"; Route _baseRoute; /** - * Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added) - */ - SwaggerGen({List interceptors, bool overrideInterceptors = false, String baseUrl}) { - _baseRoute = Route(baseUrl ?? baseSwaggerPath).withClient(globalClient ?? IOClient()); + * Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added) + */ + JaguarApiGen({List interceptors, bool overrideInterceptors = false, String baseUrl}) { + _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient()); if(interceptors == null) { this.interceptors = _defaultInterceptors; } @@ -58,9 +58,9 @@ class SwaggerGen { {{#apiInfo}}{{#apis}} /** - * Get {{classname}} instance, base route and serializer can be overridden by a given but be careful, - * by doing that all interceptors will not be executed - */ + * Get {{classname}} instance, base route and serializer can be overridden by a given but be careful, + * by doing that all interceptors will not be executed + */ {{classname}} get{{classname}}({Route base, SerializerRepo serializers}) { if(base == null) { base = _baseRoute; @@ -72,4 +72,4 @@ class SwaggerGen { } {{/apis}}{{/apiInfo}} -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/pubspec.mustache index 6ef678060283..fb6dd286ab13 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/pubspec.mustache @@ -4,9 +4,9 @@ description: {{pubDescription}} environment: sdk: ">=2.0.0 <3.0.0" dependencies: - jaguar_retrofit: '^2.4.1' - jaguar_serializer: '^2.2.0' + jaguar_retrofit: '^2.5.4' + jaguar_serializer: '^2.2.2' dev_dependencies: - jaguar_retrofit_gen: '^2.4.2' + jaguar_retrofit_gen: '^2.5.1' jaguar_serializer_cli: '^2.2.1' build_runner: '^0.10.0' \ No newline at end of file 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 d4e0b00131ff..a911cfdc2c4f 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 @@ -30,15 +30,15 @@ final jsonJaguarRepo = JsonRepo() final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()]; -class SwaggerGen { +class JaguarApiGen { List interceptors; String baseSwaggerPath = "http://petstore.swagger.io/v2"; Route _baseRoute; /** - * Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added) - */ - SwaggerGen({List interceptors, bool overrideInterceptors = false, String baseUrl}) { + * Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added) + */ + JaguarApiGen({List interceptors, bool overrideInterceptors = false, String baseUrl}) { _baseRoute = Route(baseUrl ?? baseSwaggerPath).withClient(globalClient ?? IOClient()); if(interceptors == null) { this.interceptors = _defaultInterceptors; @@ -70,9 +70,9 @@ class SwaggerGen { /** - * Get PetApi instance, base route and serializer can be overridden by a given but be careful, - * by doing that all interceptors will not be executed - */ + * Get PetApi instance, base route and serializer can be overridden by a given but be careful, + * by doing that all interceptors will not be executed + */ PetApi getPetApi({Route base, SerializerRepo serializers}) { if(base == null) { base = _baseRoute; @@ -85,9 +85,9 @@ class SwaggerGen { /** - * Get StoreApi instance, base route and serializer can be overridden by a given but be careful, - * by doing that all interceptors will not be executed - */ + * Get StoreApi instance, base route and serializer can be overridden by a given but be careful, + * by doing that all interceptors will not be executed + */ StoreApi getStoreApi({Route base, SerializerRepo serializers}) { if(base == null) { base = _baseRoute; @@ -100,9 +100,9 @@ class SwaggerGen { /** - * Get UserApi instance, base route and serializer can be overridden by a given but be careful, - * by doing that all interceptors will not be executed - */ + * Get UserApi instance, base route and serializer can be overridden by a given but be careful, + * by doing that all interceptors will not be executed + */ UserApi getUserApi({Route base, SerializerRepo serializers}) { if(base == null) { base = _baseRoute; @@ -114,4 +114,4 @@ class SwaggerGen { } -} \ No newline at end of file +} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/pet_api.dart index d2fa73c5319a..ae5f7e9c158e 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/pet_api.dart @@ -31,7 +31,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// @DeleteReq(path: "/pet/:petId", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) Future deletePet( - int petId + @PathParam("petId") int petId , @Header("api_key") String apiKey ); @@ -59,7 +59,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Returns a single pet @GetReq(path: "/pet/:petId", metadata: {"auth": [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }]}) Future getPetById( - int petId + @PathParam("petId") int petId ); /// Update an existing pet @@ -76,7 +76,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// @PostReq(path: "/pet/:petId", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) Future updatePetWithForm( - int petId + @PathParam("petId") int petId , @AsFormField() String name, @@ -88,7 +88,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// @PostReq(path: "/pet/:petId/uploadImage", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) Future uploadFile( - int petId + @PathParam("petId") int petId , @AsMultipartField() String additionalMetadata, diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/store_api.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/store_api.dart index 8462a8cbb774..b0e401042756 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/store_api.dart @@ -21,7 +21,7 @@ class StoreApi extends _$StoreApiClient implements ApiClient { /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @DeleteReq(path: "/store/order/:orderId") Future deleteOrder( - String orderId + @PathParam("orderId") String orderId ); /// Returns pet inventories by status @@ -36,7 +36,7 @@ class StoreApi extends _$StoreApiClient implements ApiClient { /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @GetReq(path: "/store/order/:orderId") Future getOrderById( - int orderId + @PathParam("orderId") int orderId ); /// Place an order for a pet diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/user_api.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/user_api.dart index bbd9e373b9e9..337375075c24 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/lib/api/user_api.dart @@ -48,7 +48,7 @@ class UserApi extends _$UserApiClient implements ApiClient { /// This can only be done by the logged in user. @DeleteReq(path: "/user/:username") Future deleteUser( - String username + @PathParam("username") String username ); /// Get user by user name @@ -56,7 +56,7 @@ class UserApi extends _$UserApiClient implements ApiClient { /// @GetReq(path: "/user/:username") Future getUserByName( - String username + @PathParam("username") String username ); /// Logs user into the system @@ -82,7 +82,7 @@ class UserApi extends _$UserApiClient implements ApiClient { /// This can only be done by the logged in user. @PutReq(path: "/user/:username") Future updateUser( - String username + @PathParam("username") String username , @AsJson() User user ); diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/pubspec.yaml b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/pubspec.yaml index 78403ea6507a..532ec86915fc 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/pubspec.yaml +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/pubspec.yaml @@ -4,9 +4,9 @@ description: OpenAPI API client environment: sdk: ">=2.0.0 <3.0.0" dependencies: - jaguar_retrofit: '^2.4.1' - jaguar_serializer: '^2.2.0' + jaguar_retrofit: '^2.5.4' + jaguar_serializer: '^2.2.2' dev_dependencies: - jaguar_retrofit_gen: '^2.4.2' + jaguar_retrofit_gen: '^2.5.1' jaguar_serializer_cli: '^2.2.1' build_runner: '^0.10.0' \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/openapi/lib/api.dart b/samples/client/petstore/dart-jaguar/openapi/lib/api.dart index d4e0b00131ff..c0108e390f6f 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/api.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/api.dart @@ -30,16 +30,16 @@ final jsonJaguarRepo = JsonRepo() final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()]; -class SwaggerGen { +class JaguarApiGen { List interceptors; - String baseSwaggerPath = "http://petstore.swagger.io/v2"; + String basePath = "http://petstore.swagger.io/v2"; Route _baseRoute; /** - * Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added) - */ - SwaggerGen({List interceptors, bool overrideInterceptors = false, String baseUrl}) { - _baseRoute = Route(baseUrl ?? baseSwaggerPath).withClient(globalClient ?? IOClient()); + * Add custom global interceptors, put overrideInterceptors to true to set your interceptors only (auth interceptors will not be added) + */ + JaguarApiGen({List interceptors, bool overrideInterceptors = false, String baseUrl}) { + _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient()); if(interceptors == null) { this.interceptors = _defaultInterceptors; } @@ -70,9 +70,9 @@ class SwaggerGen { /** - * Get PetApi instance, base route and serializer can be overridden by a given but be careful, - * by doing that all interceptors will not be executed - */ + * Get PetApi instance, base route and serializer can be overridden by a given but be careful, + * by doing that all interceptors will not be executed + */ PetApi getPetApi({Route base, SerializerRepo serializers}) { if(base == null) { base = _baseRoute; @@ -85,9 +85,9 @@ class SwaggerGen { /** - * Get StoreApi instance, base route and serializer can be overridden by a given but be careful, - * by doing that all interceptors will not be executed - */ + * Get StoreApi instance, base route and serializer can be overridden by a given but be careful, + * by doing that all interceptors will not be executed + */ StoreApi getStoreApi({Route base, SerializerRepo serializers}) { if(base == null) { base = _baseRoute; @@ -100,9 +100,9 @@ class SwaggerGen { /** - * Get UserApi instance, base route and serializer can be overridden by a given but be careful, - * by doing that all interceptors will not be executed - */ + * Get UserApi instance, base route and serializer can be overridden by a given but be careful, + * by doing that all interceptors will not be executed + */ UserApi getUserApi({Route base, SerializerRepo serializers}) { if(base == null) { base = _baseRoute; @@ -114,4 +114,4 @@ class SwaggerGen { } -} \ No newline at end of file +} diff --git a/samples/client/petstore/dart-jaguar/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart-jaguar/openapi/lib/api/pet_api.dart index d2fa73c5319a..ae5f7e9c158e 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/api/pet_api.dart @@ -31,7 +31,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// @DeleteReq(path: "/pet/:petId", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) Future deletePet( - int petId + @PathParam("petId") int petId , @Header("api_key") String apiKey ); @@ -59,7 +59,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Returns a single pet @GetReq(path: "/pet/:petId", metadata: {"auth": [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }]}) Future getPetById( - int petId + @PathParam("petId") int petId ); /// Update an existing pet @@ -76,7 +76,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// @PostReq(path: "/pet/:petId", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) Future updatePetWithForm( - int petId + @PathParam("petId") int petId , @AsFormField() String name, @@ -88,7 +88,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// @PostReq(path: "/pet/:petId/uploadImage", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) Future uploadFile( - int petId + @PathParam("petId") int petId , @AsMultipartField() String additionalMetadata, diff --git a/samples/client/petstore/dart-jaguar/openapi/lib/api/store_api.dart b/samples/client/petstore/dart-jaguar/openapi/lib/api/store_api.dart index 8462a8cbb774..b0e401042756 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/api/store_api.dart @@ -21,7 +21,7 @@ class StoreApi extends _$StoreApiClient implements ApiClient { /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @DeleteReq(path: "/store/order/:orderId") Future deleteOrder( - String orderId + @PathParam("orderId") String orderId ); /// Returns pet inventories by status @@ -36,7 +36,7 @@ class StoreApi extends _$StoreApiClient implements ApiClient { /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @GetReq(path: "/store/order/:orderId") Future getOrderById( - int orderId + @PathParam("orderId") int orderId ); /// Place an order for a pet diff --git a/samples/client/petstore/dart-jaguar/openapi/lib/api/user_api.dart b/samples/client/petstore/dart-jaguar/openapi/lib/api/user_api.dart index bbd9e373b9e9..337375075c24 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/api/user_api.dart @@ -48,7 +48,7 @@ class UserApi extends _$UserApiClient implements ApiClient { /// This can only be done by the logged in user. @DeleteReq(path: "/user/:username") Future deleteUser( - String username + @PathParam("username") String username ); /// Get user by user name @@ -56,7 +56,7 @@ class UserApi extends _$UserApiClient implements ApiClient { /// @GetReq(path: "/user/:username") Future getUserByName( - String username + @PathParam("username") String username ); /// Logs user into the system @@ -82,7 +82,7 @@ class UserApi extends _$UserApiClient implements ApiClient { /// This can only be done by the logged in user. @PutReq(path: "/user/:username") Future updateUser( - String username + @PathParam("username") String username , @AsJson() User user ); diff --git a/samples/client/petstore/dart-jaguar/openapi/pubspec.yaml b/samples/client/petstore/dart-jaguar/openapi/pubspec.yaml index 78403ea6507a..532ec86915fc 100644 --- a/samples/client/petstore/dart-jaguar/openapi/pubspec.yaml +++ b/samples/client/petstore/dart-jaguar/openapi/pubspec.yaml @@ -4,9 +4,9 @@ description: OpenAPI API client environment: sdk: ">=2.0.0 <3.0.0" dependencies: - jaguar_retrofit: '^2.4.1' - jaguar_serializer: '^2.2.0' + jaguar_retrofit: '^2.5.4' + jaguar_serializer: '^2.2.2' dev_dependencies: - jaguar_retrofit_gen: '^2.4.2' + jaguar_retrofit_gen: '^2.5.1' jaguar_serializer_cli: '^2.2.1' build_runner: '^0.10.0' \ No newline at end of file