From 012247bd27bca77dc54a185b822b13d659539c33 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 8 Sep 2018 17:51:24 +0800 Subject: [PATCH] migrate to openapi-generator --- .../languages/DartJaguarClientCodegen.java | 36 +- .../resources/dart-jaguar/README.mustache | 6 +- .../main/resources/dart-jaguar/api.mustache | 4 +- .../resources/dart-jaguar/apilib.mustache | 53 +-- .../resources/dart-jaguar/pubspec.mustache | 6 +- .../languages/DartJaguarClientCodegen.java | 184 --------- .../resources/dart-jaguar/README.mustache | 142 ------- .../dart-jaguar/analysis_options.mustache | 2 - .../main/resources/dart-jaguar/api.mustache | 53 --- .../resources/dart-jaguar/api_doc.mustache | 86 ---- .../resources/dart-jaguar/apilib.mustache | 38 -- .../main/resources/dart-jaguar/class.mustache | 26 -- .../main/resources/dart-jaguar/enum.mustache | 38 -- .../dart-jaguar/git_push.sh.mustache | 52 --- .../resources/dart-jaguar/gitignore.mustache | 27 -- .../main/resources/dart-jaguar/model.mustache | 9 - .../resources/dart-jaguar/object_doc.mustache | 16 - .../resources/dart-jaguar/pubspec.mustache | 12 - .../flutter_petstore/openapi/lib/api.dart | 61 +-- .../openapi/lib/api/pet_api.dart | 24 +- .../openapi/lib/api/store_api.dart | 12 +- .../openapi/lib/api/user_api.dart | 22 +- .../flutter_petstore/openapi/pubspec.yaml | 6 +- .../swagger/.analysis_options | 2 - .../flutter_petstore/swagger/.gitignore | 27 -- .../swagger/.swagger-codegen-ignore | 23 -- .../swagger/.swagger-codegen/VERSION | 1 - .../flutter_petstore/swagger/README.md | 125 ------ .../flutter_petstore/swagger/docs/Amount.md | 16 - .../swagger/docs/ApiResponse.md | 17 - .../flutter_petstore/swagger/docs/Category.md | 16 - .../flutter_petstore/swagger/docs/Currency.md | 14 - .../flutter_petstore/swagger/docs/Order.md | 20 - .../flutter_petstore/swagger/docs/Pet.md | 20 - .../flutter_petstore/swagger/docs/PetApi.md | 389 ------------------ .../flutter_petstore/swagger/docs/StoreApi.md | 188 --------- .../flutter_petstore/swagger/docs/Tag.md | 16 - .../flutter_petstore/swagger/docs/User.md | 22 - .../flutter_petstore/swagger/docs/UserApi.md | 359 ---------------- .../flutter_petstore/swagger/git_push.sh | 52 --- .../flutter_petstore/swagger/lib/api.dart | 74 ---- .../swagger/lib/api/pet_api.dart | 99 ----- .../swagger/lib/api/pet_api.jretro.dart | 70 ---- .../swagger/lib/api/store_api.dart | 52 --- .../swagger/lib/api/store_api.jretro.dart | 39 -- .../swagger/lib/api/user_api.dart | 91 ---- .../swagger/lib/api/user_api.jretro.dart | 70 ---- .../swagger/lib/model/amount.dart | 32 -- .../swagger/lib/model/amount.jser.dart | 31 -- .../swagger/lib/model/api_response.dart | 34 -- .../swagger/lib/model/api_response.jser.dart | 29 -- .../swagger/lib/model/category.dart | 31 -- .../swagger/lib/model/category.jser.dart | 27 -- .../swagger/lib/model/currency.dart | 23 -- .../swagger/lib/model/currency.jser.dart | 23 -- .../swagger/lib/model/order.dart | 43 -- .../swagger/lib/model/order.jser.dart | 37 -- .../swagger/lib/model/pet.dart | 45 -- .../swagger/lib/model/pet.jser.dart | 47 --- .../swagger/lib/model/tag.dart | 31 -- .../swagger/lib/model/tag.jser.dart | 27 -- .../swagger/lib/model/user.dart | 49 --- .../swagger/lib/model/user.jser.dart | 39 -- .../flutter_petstore/swagger/pubspec.yaml | 12 - .../petstore/dart-jaguar/openapi/lib/api.dart | 61 +-- .../dart-jaguar/openapi/lib/api/pet_api.dart | 24 +- .../openapi/lib/api/store_api.dart | 12 +- .../dart-jaguar/openapi/lib/api/user_api.dart | 22 +- .../petstore/dart-jaguar/openapi/pubspec.yaml | 6 +- .../dart-jaguar/swagger/.analysis_options | 2 - .../petstore/dart-jaguar/swagger/.gitignore | 27 -- .../swagger/.swagger-codegen-ignore | 23 -- .../swagger/.swagger-codegen/VERSION | 1 - .../petstore/dart-jaguar/swagger/README.md | 125 ------ .../dart-jaguar/swagger/docs/Amount.md | 16 - .../dart-jaguar/swagger/docs/ApiResponse.md | 17 - .../dart-jaguar/swagger/docs/Category.md | 16 - .../dart-jaguar/swagger/docs/Currency.md | 14 - .../dart-jaguar/swagger/docs/Order.md | 20 - .../petstore/dart-jaguar/swagger/docs/Pet.md | 20 - .../dart-jaguar/swagger/docs/PetApi.md | 389 ------------------ .../dart-jaguar/swagger/docs/StoreApi.md | 188 --------- .../petstore/dart-jaguar/swagger/docs/Tag.md | 16 - .../petstore/dart-jaguar/swagger/docs/User.md | 22 - .../dart-jaguar/swagger/docs/UserApi.md | 359 ---------------- .../petstore/dart-jaguar/swagger/git_push.sh | 52 --- .../petstore/dart-jaguar/swagger/lib/api.dart | 74 ---- .../dart-jaguar/swagger/lib/api/pet_api.dart | 99 ----- .../swagger/lib/api/pet_api.jretro.dart | 70 ---- .../swagger/lib/api/store_api.dart | 52 --- .../swagger/lib/api/store_api.jretro.dart | 39 -- .../dart-jaguar/swagger/lib/api/user_api.dart | 91 ---- .../swagger/lib/api/user_api.jretro.dart | 70 ---- .../dart-jaguar/swagger/lib/model/amount.dart | 32 -- .../swagger/lib/model/amount.jser.dart | 31 -- .../swagger/lib/model/api_response.dart | 34 -- .../swagger/lib/model/api_response.jser.dart | 29 -- .../swagger/lib/model/category.dart | 31 -- .../swagger/lib/model/category.jser.dart | 27 -- .../swagger/lib/model/currency.dart | 23 -- .../swagger/lib/model/currency.jser.dart | 23 -- .../dart-jaguar/swagger/lib/model/order.dart | 43 -- .../swagger/lib/model/order.jser.dart | 37 -- .../dart-jaguar/swagger/lib/model/pet.dart | 45 -- .../swagger/lib/model/pet.jser.dart | 47 --- .../dart-jaguar/swagger/lib/model/tag.dart | 31 -- .../swagger/lib/model/tag.jser.dart | 27 -- .../dart-jaguar/swagger/lib/model/user.dart | 49 --- .../swagger/lib/model/user.jser.dart | 39 -- .../petstore/dart-jaguar/swagger/pubspec.yaml | 12 - 110 files changed, 114 insertions(+), 5650 deletions(-) delete mode 100644 modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartJaguarClientCodegen.java delete mode 100644 modules/swagger-codegen/src/main/resources/dart-jaguar/README.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/dart-jaguar/analysis_options.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/dart-jaguar/api.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/dart-jaguar/api_doc.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/dart-jaguar/apilib.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/dart-jaguar/class.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/dart-jaguar/enum.mustache delete mode 100755 modules/swagger-codegen/src/main/resources/dart-jaguar/git_push.sh.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/dart-jaguar/gitignore.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/dart-jaguar/model.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/dart-jaguar/object_doc.mustache delete mode 100644 modules/swagger-codegen/src/main/resources/dart-jaguar/pubspec.mustache delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.analysis_options delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.gitignore delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.swagger-codegen-ignore delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.swagger-codegen/VERSION delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/README.md delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Amount.md delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/ApiResponse.md delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Category.md delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Currency.md delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Order.md delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Pet.md delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/PetApi.md delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/StoreApi.md delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Tag.md delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/User.md delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/UserApi.md delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/git_push.sh delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/pet_api.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/pet_api.jretro.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/store_api.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/store_api.jretro.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/user_api.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/user_api.jretro.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/amount.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/amount.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/api_response.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/api_response.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/category.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/category.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/currency.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/currency.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/order.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/order.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/pet.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/pet.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/tag.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/tag.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/user.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/user.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/flutter_petstore/swagger/pubspec.yaml delete mode 100644 samples/client/petstore/dart-jaguar/swagger/.analysis_options delete mode 100644 samples/client/petstore/dart-jaguar/swagger/.gitignore delete mode 100644 samples/client/petstore/dart-jaguar/swagger/.swagger-codegen-ignore delete mode 100644 samples/client/petstore/dart-jaguar/swagger/.swagger-codegen/VERSION delete mode 100644 samples/client/petstore/dart-jaguar/swagger/README.md delete mode 100644 samples/client/petstore/dart-jaguar/swagger/docs/Amount.md delete mode 100644 samples/client/petstore/dart-jaguar/swagger/docs/ApiResponse.md delete mode 100644 samples/client/petstore/dart-jaguar/swagger/docs/Category.md delete mode 100644 samples/client/petstore/dart-jaguar/swagger/docs/Currency.md delete mode 100644 samples/client/petstore/dart-jaguar/swagger/docs/Order.md delete mode 100644 samples/client/petstore/dart-jaguar/swagger/docs/Pet.md delete mode 100644 samples/client/petstore/dart-jaguar/swagger/docs/PetApi.md delete mode 100644 samples/client/petstore/dart-jaguar/swagger/docs/StoreApi.md delete mode 100644 samples/client/petstore/dart-jaguar/swagger/docs/Tag.md delete mode 100644 samples/client/petstore/dart-jaguar/swagger/docs/User.md delete mode 100644 samples/client/petstore/dart-jaguar/swagger/docs/UserApi.md delete mode 100644 samples/client/petstore/dart-jaguar/swagger/git_push.sh delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/api.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/api/pet_api.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/api/pet_api.jretro.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/api/store_api.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/api/store_api.jretro.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/api/user_api.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/api/user_api.jretro.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/amount.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/amount.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/api_response.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/api_response.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/category.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/category.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/currency.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/currency.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/order.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/order.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/pet.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/pet.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/tag.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/tag.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/user.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/lib/model/user.jser.dart delete mode 100644 samples/client/petstore/dart-jaguar/swagger/pubspec.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java index 9ca833b5f319..dd286bbdbb89 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java @@ -16,9 +16,17 @@ package org.openapitools.codegen.languages; +import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Template; +import io.swagger.models.Model; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.DefaultCodegen; import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.utils.ModelUtils; @@ -27,22 +35,22 @@ import org.apache.commons.lang3.StringUtils; import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.io.Writer; import java.util.HashSet; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.Set; public class DartJaguarClientCodegen extends DartClientCodegen { private static Set modelToIgnore = new HashSet<>(); - static { modelToIgnore.add("datetime"); - modelToIgnore.add("map"); modelToIgnore.add("list"); + modelToIgnore.add("map"); modelToIgnore.add("file"); } - public DartJaguarClientCodegen() { super(); browserClient = false; @@ -110,20 +118,15 @@ public void processOpts() { final String libFolder = sourceFolder + File.separator + "lib"; supportingFiles.add(new SupportingFile("pubspec.mustache", "", "pubspec.yaml")); - supportingFiles.add(new SupportingFile("analysis_options.mustache", "", "analysis_options.yaml")); + supportingFiles.add(new SupportingFile("analysis_options.mustache", "", ".analysis_options")); supportingFiles.add(new SupportingFile("apilib.mustache", libFolder, "api.dart")); supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - - final String authFolder = sourceFolder + File.separator + "lib" + File.separator + "auth"; - supportingFiles.add(new SupportingFile("auth/api_key_auth.mustache", authFolder, "api_key_auth.dart")); - supportingFiles.add(new SupportingFile("auth/basic_auth.mustache", authFolder, "basic_auth.dart")); - supportingFiles.add(new SupportingFile("auth/oauth.mustache", authFolder, "oauth.dart")); - supportingFiles.add(new SupportingFile("auth/auth.mustache", authFolder, "auth.dart")); } + @Override public Map postProcessModels(Map objs) { objs = super.postProcessModels(objs); @@ -133,13 +136,14 @@ public Map postProcessModels(Map objs) { Set modelImports = new HashSet<>(); CodegenModel cm = (CodegenModel) mo.get("model"); for (String modelImport : cm.imports) { - if (!modelToIgnore.contains(modelImport.toLowerCase(Locale.ROOT))) { + if(!modelToIgnore.contains(modelImport.toLowerCase())) { modelImports.add(underscore(modelImport)); } } cm.imports = modelImports; cm.vendorExtensions.put("hasVars", cm.vars.size() > 0); } + //objs.put("modelImports", modelImports); return objs; } @@ -152,11 +156,11 @@ public Map postProcessOperations(Map objs) { Set modelImports = new HashSet<>(); for (CodegenOperation op : operationList) { - op.httpMethod = StringUtils.capitalize(op.httpMethod.toLowerCase(Locale.ROOT)); + op.httpMethod = StringUtils.capitalize(op.httpMethod.toLowerCase()); boolean isJson = true; //default to JSON boolean isForm = false; boolean isMultipart = false; - if (op.consumes != null) { + if(op.consumes != null) { for (Map consume : op.consumes) { if (consume.containsKey("mediaType")) { String type = consume.get("mediaType"); @@ -174,7 +178,7 @@ public Map postProcessOperations(Map objs) { Set imports = new HashSet<>(); for (String item : op.imports) { - if (!modelToIgnore.contains(item.toLowerCase(Locale.ROOT))) { + if(!modelToIgnore.contains(item.toLowerCase())) { imports.add(underscore(item)); } } @@ -191,7 +195,7 @@ public Map postProcessOperations(Map objs) { jaguarPath = jaguarPath + items[i]; } - if (i != items.length - 1) { + if (i != items.length -1) { jaguarPath = jaguarPath + "/"; } } 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 f3e63b485e17..8887881dc355 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 [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: +This Dart package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: {{appVersion}} {{#artifactVersion}} @@ -82,8 +82,8 @@ import 'package:{{pubName}}/api.dart'; {{/authMethods}} {{/hasAuthMethods}} -final jaguarApiGen = JaguarApiGen(); -var api_instance = jaguarApiGen.get{{classname}}(); +final swaggerGen = SwaggerGen(); +var api_instance = swaggerGen.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 762cb6a0fb11..4ca22bfe90d1 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache @@ -22,10 +22,10 @@ class {{classname}} extends _${{classname}}Client implements ApiClient { /// {{summary}} /// /// {{notes}} - @{{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}}) + @{{httpMethod}}Req(path: '{{path}}') Future<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{nickname}}( {{#pathParams}} - @PathParam("{{baseName}}") {{dataType}} {{paramName}}{{#hasMore}}, {{/hasMore}} + {{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 71cfe8618a20..873f745a55d9 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/apilib.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/apilib.mustache @@ -1,11 +1,7 @@ library {{pubName}}.api; -import 'package:http/http.dart'; import 'package:jaguar_serializer/jaguar_serializer.dart'; import 'package:jaguar_retrofit/jaguar_retrofit.dart'; -import 'package:{{pubName}}/auth/api_key_auth.dart'; -import 'package:{{pubName}}/auth/basic_auth.dart'; -import 'package:{{pubName}}/auth/oauth.dart'; {{#apiInfo}}{{#apis}}import 'package:{{pubName}}/api/{{classFilename}}.dart'; {{/apis}}{{/apiInfo}} @@ -16,52 +12,19 @@ final jsonJaguarRepo = JsonRepo() {{#models}}{{#model}}..add({{classname}}Serializer()) {{/model}}{{/models}}; -final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()]; +final baseSwaggerPath = "{{basePath}}"; +final _baseRoute = Route(baseSwaggerPath); -class JaguarApiGen { - List interceptors; - String basePath = "{{basePath}}"; - Route _baseRoute; - - /** - * 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; - } - else if(overrideInterceptors){ - this.interceptors = interceptors; - } - else { - this.interceptors = List.from(_defaultInterceptors)..addAll(interceptors); - } - - this.interceptors.forEach((interceptor) { +class SwaggerGen { + final List interceptors; + SwaggerGen({this.interceptors = const []}) { + interceptors.forEach((interceptor) { _baseRoute.before(interceptor.before); _baseRoute.after(interceptor.after); }); } - void setOAuthToken(String name, String token) { - (_defaultInterceptors[0] as OAuthInterceptor).tokens[name] = token; - } - - void setBasicAuth(String name, String username, String password) { - (_defaultInterceptors[1] as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); - } - - void setApiKey(String name, String apiKey) { - (_defaultInterceptors[2] as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; - } - - {{#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 - */ - {{classname}} get{{classname}}({Route base, SerializerRepo serializers}) { + {{#apiInfo}}{{#apis}}{{classname}} get{{classname}}({Route base, SerializerRepo serializers}) { if(base == null) { base = _baseRoute; } @@ -72,4 +35,4 @@ class JaguarApiGen { } {{/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 30bdbdc28e55..6ef678060283 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.5.4' - jaguar_serializer: '^2.2.2' + jaguar_retrofit: '^2.4.1' + jaguar_serializer: '^2.2.0' dev_dependencies: - jaguar_retrofit_gen: '^2.5.2' + jaguar_retrofit_gen: '^2.4.2' jaguar_serializer_cli: '^2.2.1' build_runner: '^0.10.0' \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartJaguarClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartJaguarClientCodegen.java deleted file mode 100644 index a55f8e1a53b6..000000000000 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartJaguarClientCodegen.java +++ /dev/null @@ -1,184 +0,0 @@ -package io.swagger.codegen.languages; - -import com.samskivert.mustache.Mustache; -import com.samskivert.mustache.Template; -import io.swagger.codegen.*; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.MapProperty; -import io.swagger.models.properties.Property; -import org.apache.commons.lang3.StringUtils; - -import java.io.File; -import java.io.IOException; -import java.io.StringWriter; -import java.io.Writer; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -public class DartJaguarClientCodegen extends DartClientCodegen { - private static Set modelToIgnore = new HashSet<>(); - static { - modelToIgnore.add("datetime"); - modelToIgnore.add("list"); - modelToIgnore.add("map"); - modelToIgnore.add("file"); - } - public DartJaguarClientCodegen() { - super(); - browserClient = false; - outputFolder = "generated-code/dart-jaguar"; - embeddedTemplateDir = templateDir = "dart-jaguar"; - } - - @Override - public String getName() { - return "dart-jaguar"; - } - - @Override - public String getHelp() { - return "Generates a Dart Jaguar client library."; - } - - @Override - public String toDefaultValue(Property p) { - if (p instanceof MapProperty) { - return "const {}"; - } else if (p instanceof ArrayProperty) { - return "const []"; - } - return super.toDefaultValue(p); - } - - @Override - public void processOpts() { - if (additionalProperties.containsKey(PUB_NAME)) { - this.setPubName((String) additionalProperties.get(PUB_NAME)); - } else { - //not set, use to be passed to template - additionalProperties.put(PUB_NAME, pubName); - } - - if (additionalProperties.containsKey(PUB_VERSION)) { - this.setPubVersion((String) additionalProperties.get(PUB_VERSION)); - } else { - //not set, use to be passed to template - additionalProperties.put(PUB_VERSION, pubVersion); - } - - if (additionalProperties.containsKey(PUB_DESCRIPTION)) { - this.setPubDescription((String) additionalProperties.get(PUB_DESCRIPTION)); - } else { - //not set, use to be passed to template - additionalProperties.put(PUB_DESCRIPTION, pubDescription); - } - - if (additionalProperties.containsKey(USE_ENUM_EXTENSION)) { - this.setUseEnumExtension(convertPropertyToBooleanAndWriteBack(USE_ENUM_EXTENSION)); - } else { - // Not set, use to be passed to template. - additionalProperties.put(USE_ENUM_EXTENSION, useEnumExtension); - } - - if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) { - this.setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); - } - - // make api and model doc path available in mustache template - additionalProperties.put("apiDocPath", apiDocPath); - additionalProperties.put("modelDocPath", modelDocPath); - - final String libFolder = sourceFolder + File.separator + "lib"; - supportingFiles.add(new SupportingFile("pubspec.mustache", "", "pubspec.yaml")); - supportingFiles.add(new SupportingFile("analysis_options.mustache", "", ".analysis_options")); - supportingFiles.add(new SupportingFile("apilib.mustache", libFolder, "api.dart")); - - supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); - supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); - supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); - } - - - @Override - public Map postProcessModels(Map objs) { - objs = super.postProcessModels(objs); - List models = (List) objs.get("models"); - for (Object _mo : models) { - Map mo = (Map) _mo; - Set modelImports = new HashSet<>(); - CodegenModel cm = (CodegenModel) mo.get("model"); - for (String modelImport : cm.imports) { - if(!modelToIgnore.contains(modelImport.toLowerCase())) { - modelImports.add(underscore(modelImport)); - } - } - cm.imports = modelImports; - cm.vendorExtensions.put("hasVars", cm.vars.size() > 0); - } - //objs.put("modelImports", modelImports); - return objs; - } - - @Override - public Map postProcessOperations(Map objs) { - objs = super.postProcessOperations(objs); - Map operations = (Map) objs.get("operations"); - List operationList = (List) operations.get("operation"); - - Set modelImports = new HashSet<>(); - - for (CodegenOperation op : operationList) { - op.httpMethod = StringUtils.capitalize(op.httpMethod.toLowerCase()); - boolean isJson = true; //default to JSON - boolean isForm = false; - boolean isMultipart = false; - if(op.consumes != null) { - for (Map consume : op.consumes) { - if (consume.containsKey("mediaType")) { - String type = consume.get("mediaType"); - isJson = type.equalsIgnoreCase("application/json"); - isForm = type.equalsIgnoreCase("application/x-www-form-urlencoded"); - isMultipart = type.equalsIgnoreCase("multipart/form-data"); - break; - } - } - } - - op.vendorExtensions.put("isJson", isJson); - op.vendorExtensions.put("isForm", isForm); - op.vendorExtensions.put("isMultipart", isMultipart); - - Set imports = new HashSet<>(); - for (String item : op.imports) { - if(!modelToIgnore.contains(item.toLowerCase())) { - imports.add(underscore(item)); - } - } - modelImports.addAll(imports); - op.imports = imports; - - String[] items = op.path.split("/", -1); - String jaguarPath = ""; - - for (int i = 0; i < items.length; ++i) { - if (items[i].matches("^\\{(.*)\\}$")) { // wrap in {} - jaguarPath = jaguarPath + ":" + items[i].replace("{", "").replace("}", ""); - } else { - jaguarPath = jaguarPath + items[i]; - } - - if (i != items.length -1) { - jaguarPath = jaguarPath + "/"; - } - } - - op.path = jaguarPath; - } - - objs.put("modelImports", modelImports); - - return objs; - } -} diff --git a/modules/swagger-codegen/src/main/resources/dart-jaguar/README.mustache b/modules/swagger-codegen/src/main/resources/dart-jaguar/README.mustache deleted file mode 100644 index 8887881dc355..000000000000 --- a/modules/swagger-codegen/src/main/resources/dart-jaguar/README.mustache +++ /dev/null @@ -1,142 +0,0 @@ -# {{pubName}} -{{#appDescription}} -{{{appDescription}}} -{{/appDescription}} - -This Dart package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: {{appVersion}} -{{#artifactVersion}} -- Package version: {{artifactVersion}} -{{/artifactVersion}} -{{^hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Build package: {{generatorClass}} -{{#infoUrl}} -For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) -{{/infoUrl}} - -## Requirements - -Dart 2 or later OR Flutter 0.7.0 or later. - -Once your code is generated, you need to run the build_runner command to let Jaguar implement your API: - -```sh -flutter packages pub run build_runner build -or -pub run build_runner build -``` - -## Installation & Usage - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -``` -name: {{pubName}} -version: {{pubVersion}} -description: {{pubDescription}} -dependencies: - {{pubName}}: - git: https://github.com/{{gitUserId}}/{{gitRepoId}}.git - version: 'any' -``` - -### Local -To use the package in your local drive, please include the following in pubspec.yaml -``` -dependencies: - {{pubName}}: - path: /path/to/{{pubName}} -``` - -## Tests - -TODO - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:{{pubName}}/api.dart'; -{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}} -{{#hasAuthMethods}} -{{#authMethods}} -{{#isBasic}} -// TODO Configure HTTP basic authorization: {{{name}}} -//{{pubName}}.api.Configuration.username = 'YOUR_USERNAME'; -//{{pubName}}.api.Configuration.password = 'YOUR_PASSWORD'; -{{/isBasic}} -{{#isApiKey}} -// TODO Configure API key authorization: {{{name}}} -//{{pubName}}.api.Configuration.apiKey{'{{{keyParamName}}}'} = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//{{pubName}}.api.Configuration.apiKeyPrefix{'{{{keyParamName}}}'} = "Bearer"; -{{/isApiKey}} -{{#isOAuth}} -// TODO Configure OAuth2 access token for authorization: {{{name}}} -//{{pubName}}.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -{{/isOAuth}} -{{/authMethods}} -{{/hasAuthMethods}} - -final swaggerGen = SwaggerGen(); -var api_instance = swaggerGen.get{{classname}}(); -{{#allParams}} -var {{paramName}} = {{#isListContainer}}[{{/isListContainer}}{{#isBodyParam}}new {{dataType}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isListContainer}}]{{/isListContainer}}; // {{{dataType}}} | {{{description}}} -{{/allParams}} - -try { - {{#returnType}}var result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); - {{#returnType}} - print(result); - {{/returnType}} -} catch (e) { - print("Exception when calling {{classname}}->{{operationId}}: $e\n"); -} -{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}} -``` - -## Documentation for API Endpoints - -All URIs are relative to *{{basePath}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation For Models - -{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}/{{{classname}}}.md) -{{/model}}{{/models}} - -## Documentation For Authorization - -{{^authMethods}} All endpoints do not require authorization. -{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} -{{#authMethods}}## {{{name}}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{{keyParamName}}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} -{{#isOAuth}}- **Type**: OAuth -- **Flow**: {{{flow}}} -- **Authorization URL**: {{{authorizationUrl}}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - **{{{scope}}}**: {{{description}}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} - -## Author - -{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} -{{/hasMore}}{{/apis}}{{/apiInfo}} - diff --git a/modules/swagger-codegen/src/main/resources/dart-jaguar/analysis_options.mustache b/modules/swagger-codegen/src/main/resources/dart-jaguar/analysis_options.mustache deleted file mode 100644 index 518eb901a6ff..000000000000 --- a/modules/swagger-codegen/src/main/resources/dart-jaguar/analysis_options.mustache +++ /dev/null @@ -1,2 +0,0 @@ -analyzer: - strong-mode: true \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/dart-jaguar/api.mustache b/modules/swagger-codegen/src/main/resources/dart-jaguar/api.mustache deleted file mode 100644 index 4ca22bfe90d1..000000000000 --- a/modules/swagger-codegen/src/main/resources/dart-jaguar/api.mustache +++ /dev/null @@ -1,53 +0,0 @@ -import 'package:jaguar_retrofit/annotations/annotations.dart'; -import 'package:jaguar_retrofit/jaguar_retrofit.dart'; -import 'package:jaguar_serializer/jaguar_serializer.dart'; -import 'package:jaguar_serializer/src/repo/repo.dart'; -import 'dart:async'; - -{{#operations}} -{{#modelImports}}import 'package:{{pubName}}/model/{{.}}.dart'; -{{/modelImports}} - - -part '{{classFilename}}.jretro.dart'; - -@GenApiClient() -class {{classname}} extends _${{classname}}Client implements ApiClient { - final Route base; - final SerializerRepo serializers; - - {{classname}}({this.base, this.serializers}); - - {{#operation}} - /// {{summary}} - /// - /// {{notes}} - @{{httpMethod}}Req(path: '{{path}}') - Future<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{nickname}}( - {{#pathParams}} - {{dataType}} {{paramName}}{{#hasMore}}, {{/hasMore}} - {{/pathParams}} - {{#headerParams}} - {{#-first}}{{#hasPathParams}},{{/hasPathParams}}{{/-first}} - @Header("{{baseName}}") {{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}} - {{/headerParams}} - {{#queryParams}} - {{#-first}}{{#hasHeaderParams}},{{/hasHeaderParams}}{{^hasHeaderParams}}{{#hasPathParams}},{{/hasPathParams}}{{/hasHeaderParams}}{{/-first}} - @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}} - {{/queryParams}} - {{#vendorExtensions}} - {{#formParams}} - {{#-first}}{{#hasQueryParams}},{{/hasQueryParams}}{{^hasQueryParams}}{{#hasHeaderParams}},{{/hasHeaderParams}}{{/hasQueryParams}}{{^hasQueryParams}}{{^hasHeaderParams}}{{#hasPathParams}},{{/hasPathParams}}{{/hasHeaderParams}}{{/hasQueryParams}}{{/-first}} - {{#isJson}}@AsJson() {{/isJson}}{{#isForm}}@AsFormField() {{/isForm}}{{#isMultipart}}@AsMultipartField() {{/isMultipart}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}} - {{/formParams}} - {{#bodyParam}} - {{#hasFormParams}},{{/hasFormParams}}{{^hasFormParams}}{{#hasQueryParams}},{{/hasQueryParams}}{{/hasFormParams}}{{^hasFormParams}}{{^hasQueryParams}}{{#hasHeaderParams}},{{/hasHeaderParams}}{{/hasQueryParams}}{{/hasFormParams}}{{^hasFormParams}}{{^hasQueryParams}}{{^hasHeaderParams}}{{#hasPathParams}},{{/hasPathParams}}{{/hasHeaderParams}}{{/hasQueryParams}}{{/hasFormParams}} - {{#isJson}}@AsJson() {{/isJson}}{{#isForm}}@AsForm() {{/isForm}}{{#isMultipart}}@AsMultipart() {{/isMultipart}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}} - {{/bodyParam}} - {{/vendorExtensions}} - ); - - {{/operation}} - -} -{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/dart-jaguar/api_doc.mustache b/modules/swagger-codegen/src/main/resources/dart-jaguar/api_doc.mustache deleted file mode 100644 index e723114f18c1..000000000000 --- a/modules/swagger-codegen/src/main/resources/dart-jaguar/api_doc.mustache +++ /dev/null @@ -1,86 +0,0 @@ -# {{pubName}}.api.{{classname}}{{#description}} -{{description}}{{/description}} - -## Load the API package -```dart -import 'package:{{pubName}}/api.dart'; -``` - -All URIs are relative to *{{basePath}}* - -Method | HTTP request | Description -------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} -{{/operation}}{{/operations}} - -{{#operations}} -{{#operation}} -# **{{{operationId}}}** -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) - -{{{summary}}}{{#notes}} - -{{{notes}}}{{/notes}} - -### Example -```dart -import 'package:{{pubName}}/api.dart'; -{{#hasAuthMethods}} -{{#authMethods}} -{{#isBasic}} -// TODO Configure HTTP basic authorization: {{{name}}} -//{{pubName}}.api.Configuration.username = 'YOUR_USERNAME'; -//{{pubName}}.api.Configuration.password = 'YOUR_PASSWORD'; -{{/isBasic}} -{{#isApiKey}} -// TODO Configure API key authorization: {{{name}}} -//{{pubName}}.api.Configuration.apiKey{'{{{keyParamName}}}'} = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//{{pubName}}.api.Configuration.apiKeyPrefix{'{{{keyParamName}}}'} = "Bearer"; -{{/isApiKey}} -{{#isOAuth}} -// TODO Configure OAuth2 access token for authorization: {{{name}}} -//{{pubName}}.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -{{/isOAuth}} -{{/authMethods}} -{{/hasAuthMethods}} - -var api_instance = new {{classname}}(); -{{#allParams}} -var {{paramName}} = {{#isListContainer}}[{{/isListContainer}}{{#isBodyParam}}new {{dataType}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isListContainer}}]{{/isListContainer}}; // {{{dataType}}} | {{{description}}} -{{/allParams}} - -try { - {{#returnType}}var result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); - {{#returnType}} - print(result); - {{/returnType}} -} catch (e) { - print("Exception when calling {{classname}}->{{operationId}}: $e\n"); -} -``` - -### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} -Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} -{{/allParams}} - -### Return type - -{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} - -### Authorization - -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} - -### HTTP request headers - - - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -{{/operation}} -{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/dart-jaguar/apilib.mustache b/modules/swagger-codegen/src/main/resources/dart-jaguar/apilib.mustache deleted file mode 100644 index 873f745a55d9..000000000000 --- a/modules/swagger-codegen/src/main/resources/dart-jaguar/apilib.mustache +++ /dev/null @@ -1,38 +0,0 @@ -library {{pubName}}.api; - -import 'package:jaguar_serializer/jaguar_serializer.dart'; -import 'package:jaguar_retrofit/jaguar_retrofit.dart'; - -{{#apiInfo}}{{#apis}}import 'package:{{pubName}}/api/{{classFilename}}.dart'; -{{/apis}}{{/apiInfo}} -{{#models}}{{#model}}import 'package:{{pubName}}/model/{{classFilename}}.dart'; -{{/model}}{{/models}} - -final jsonJaguarRepo = JsonRepo() -{{#models}}{{#model}}..add({{classname}}Serializer()) -{{/model}}{{/models}}; - -final baseSwaggerPath = "{{basePath}}"; -final _baseRoute = Route(baseSwaggerPath); - -class SwaggerGen { - final List interceptors; - SwaggerGen({this.interceptors = const []}) { - interceptors.forEach((interceptor) { - _baseRoute.before(interceptor.before); - _baseRoute.after(interceptor.after); - }); - } - - {{#apiInfo}}{{#apis}}{{classname}} get{{classname}}({Route base, SerializerRepo serializers}) { - if(base == null) { - base = _baseRoute; - } - if(serializers == null) { - serializers = jsonJaguarRepo; - } - return {{classname}}(base: base, serializers: serializers); - } - - {{/apis}}{{/apiInfo}} -} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/dart-jaguar/class.mustache b/modules/swagger-codegen/src/main/resources/dart-jaguar/class.mustache deleted file mode 100644 index 6507390a0f70..000000000000 --- a/modules/swagger-codegen/src/main/resources/dart-jaguar/class.mustache +++ /dev/null @@ -1,26 +0,0 @@ -part '{{classFilename}}.jser.dart'; - -class {{classname}} { - {{#vars}}{{#description}} /* {{{description}}} */{{/description}} - final {{{datatype}}} {{name}}; - {{#allowableValues}}{{#min}} // range from {{min}} to {{max}}{{/min}}//{{^min}}enum {{name}}Enum { {{#values}} {{.}}, {{/values}} };{{/min}}{{/allowableValues}}{{/vars}} - - {{classname}}( - {{#vars}}{{^defaultValue}}{{#required}} this.{{name}}, {{/required}}{{/defaultValue}}{{/vars}} - -{{#vendorExtensions}}{{#hasVars}}{ - {{#vars}}{{^required}} this.{{name}}{{#defaultValue}} = {{{defaultValue}}}{{#hasMore}}, {{/hasMore}} {{/defaultValue}}{{/required}} - {{#required}} {{#defaultValue}}this.{{name}} = {{{defaultValue}}}{{#hasMore}}, {{/hasMore}} {{/defaultValue}}{{/required}}{{/vars}} - }{{/hasVars}}{{/vendorExtensions}} - ); - - @override - String toString() { - return '{{classname}}[{{#vars}}{{name}}=${{name}}, {{/vars}}]'; - } -} - -@GenSerializer() -class {{classname}}Serializer extends Serializer<{{classname}}> with _${{classname}}Serializer { - -} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/dart-jaguar/enum.mustache b/modules/swagger-codegen/src/main/resources/dart-jaguar/enum.mustache deleted file mode 100644 index db68c114211e..000000000000 --- a/modules/swagger-codegen/src/main/resources/dart-jaguar/enum.mustache +++ /dev/null @@ -1,38 +0,0 @@ -part '{{classFilename}}.jser.dart'; - -@Entity() -class {{classname}} { - /// The underlying value of this enum member. - final {{dataType}} value; - - const {{classname}}._internal(this.value); - - {{#allowableValues}} - {{#enumVars}} - {{#description}} - /// {{description}} - {{/description}} - static const {{classname}} {{name}} = const {{classname}}._internal({{value}}); - {{/enumVars}} - {{/allowableValues}} -} - -class {{classname}}TypeTransformer extends TypeTransformer<{{classname}}> { - - @override - dynamic encode({{classname}} data) { - return data.value; - } - - @override - {{classname}} decode(dynamic data) { - switch (data) { - {{#allowableValues}} - {{#enumVars}} - case {{value}}: return {{classname}}.{{name}}; - {{/enumVars}} - {{/allowableValues}} - default: throw('Unknown enum value to decode: $data'); - } - } -} diff --git a/modules/swagger-codegen/src/main/resources/dart-jaguar/git_push.sh.mustache b/modules/swagger-codegen/src/main/resources/dart-jaguar/git_push.sh.mustache deleted file mode 100755 index 92d71b84970d..000000000000 --- a/modules/swagger-codegen/src/main/resources/dart-jaguar/git_push.sh.mustache +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="{{{gitUserId}}}" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="{{{gitRepoId}}}" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="{{{releaseNote}}}" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/swagger-codegen/src/main/resources/dart-jaguar/gitignore.mustache b/modules/swagger-codegen/src/main/resources/dart-jaguar/gitignore.mustache deleted file mode 100644 index 7c2804416498..000000000000 --- a/modules/swagger-codegen/src/main/resources/dart-jaguar/gitignore.mustache +++ /dev/null @@ -1,27 +0,0 @@ -# See https://www.dartlang.org/tools/private-files.html - -# Files and directories created by pub -.buildlog -.packages -.project -.pub/ -build/ -**/packages/ - -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json - -# Directory created by dartdoc -doc/api/ - -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock diff --git a/modules/swagger-codegen/src/main/resources/dart-jaguar/model.mustache b/modules/swagger-codegen/src/main/resources/dart-jaguar/model.mustache deleted file mode 100644 index d8e5f09b73d7..000000000000 --- a/modules/swagger-codegen/src/main/resources/dart-jaguar/model.mustache +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -{{#models}} -{{#model}} -{{#imports}}import 'package:{{pubName}}/model/{{.}}.dart'; -{{/imports}} -{{#isEnum}}{{>enum}}{{/isEnum}}{{^isEnum}}{{>class}}{{/isEnum}} -{{/model}} -{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/dart-jaguar/object_doc.mustache b/modules/swagger-codegen/src/main/resources/dart-jaguar/object_doc.mustache deleted file mode 100644 index 9ad4463997bc..000000000000 --- a/modules/swagger-codegen/src/main/resources/dart-jaguar/object_doc.mustache +++ /dev/null @@ -1,16 +0,0 @@ -{{#models}}{{#model}}# {{pubName}}.model.{{classname}} - -## Load the model package -```dart -import 'package:{{pubName}}/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} -{{/vars}} - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - -{{/model}}{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/dart-jaguar/pubspec.mustache b/modules/swagger-codegen/src/main/resources/dart-jaguar/pubspec.mustache deleted file mode 100644 index 6ef678060283..000000000000 --- a/modules/swagger-codegen/src/main/resources/dart-jaguar/pubspec.mustache +++ /dev/null @@ -1,12 +0,0 @@ -name: {{pubName}} -version: {{pubVersion}} -description: {{pubDescription}} -environment: - sdk: ">=2.0.0 <3.0.0" -dependencies: - jaguar_retrofit: '^2.4.1' - jaguar_serializer: '^2.2.0' -dev_dependencies: - jaguar_retrofit_gen: '^2.4.2' - 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 c0108e390f6f..98651e2cf236 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 @@ -1,11 +1,7 @@ library openapi.api; -import 'package:http/http.dart'; import 'package:jaguar_serializer/jaguar_serializer.dart'; import 'package:jaguar_retrofit/jaguar_retrofit.dart'; -import 'package:openapi/auth/api_key_auth.dart'; -import 'package:openapi/auth/basic_auth.dart'; -import 'package:openapi/auth/oauth.dart'; import 'package:openapi/api/pet_api.dart'; import 'package:openapi/api/store_api.dart'; @@ -28,51 +24,18 @@ final jsonJaguarRepo = JsonRepo() ..add(UserSerializer()) ; -final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()]; +final baseSwaggerPath = "http://petstore.swagger.io/v2"; +final _baseRoute = Route(baseSwaggerPath); -class JaguarApiGen { - List interceptors; - 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) - */ - JaguarApiGen({List interceptors, bool overrideInterceptors = false, String baseUrl}) { - _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient()); - if(interceptors == null) { - this.interceptors = _defaultInterceptors; - } - else if(overrideInterceptors){ - this.interceptors = interceptors; - } - else { - this.interceptors = List.from(_defaultInterceptors)..addAll(interceptors); - } - - this.interceptors.forEach((interceptor) { +class SwaggerGen { + final List interceptors; + SwaggerGen({this.interceptors = const []}) { + interceptors.forEach((interceptor) { _baseRoute.before(interceptor.before); _baseRoute.after(interceptor.after); }); } - void setOAuthToken(String name, String token) { - (_defaultInterceptors[0] as OAuthInterceptor).tokens[name] = token; - } - - void setBasicAuth(String name, String username, String password) { - (_defaultInterceptors[1] as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); - } - - void setApiKey(String name, String apiKey) { - (_defaultInterceptors[2] as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; - } - - - /** - * 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; @@ -83,11 +46,6 @@ class JaguarApiGen { return PetApi(base: base, serializers: serializers); } - - /** - * 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; @@ -98,11 +56,6 @@ class JaguarApiGen { return StoreApi(base: base, serializers: serializers); } - - /** - * 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 +67,4 @@ class JaguarApiGen { } -} +} \ 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 ae5f7e9c158e..6b7f806abe35 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 @@ -20,7 +20,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Add a new pet to the store /// /// - @PostReq(path: "/pet", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @PostReq(path: '/pet') Future addPet( @AsJson() Pet pet @@ -29,9 +29,9 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Deletes a pet /// /// - @DeleteReq(path: "/pet/:petId", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @DeleteReq(path: '/pet/:petId') Future deletePet( - @PathParam("petId") int petId + int petId , @Header("api_key") String apiKey ); @@ -39,7 +39,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Finds Pets by status /// /// Multiple status values can be provided with comma separated strings - @GetReq(path: "/pet/findByStatus", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @GetReq(path: '/pet/findByStatus') Future> findPetsByStatus( @QueryParam("status") List status @@ -48,7 +48,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Finds Pets by tags /// /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - @GetReq(path: "/pet/findByTags", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @GetReq(path: '/pet/findByTags') Future> findPetsByTags( @QueryParam("tags") List tags @@ -57,15 +57,15 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Find pet by ID /// /// Returns a single pet - @GetReq(path: "/pet/:petId", metadata: {"auth": [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }]}) + @GetReq(path: '/pet/:petId') Future getPetById( - @PathParam("petId") int petId + int petId ); /// Update an existing pet /// /// - @PutReq(path: "/pet", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @PutReq(path: '/pet') Future updatePet( @AsJson() Pet pet @@ -74,9 +74,9 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Updates a pet in the store with form data /// /// - @PostReq(path: "/pet/:petId", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @PostReq(path: '/pet/:petId') Future updatePetWithForm( - @PathParam("petId") int petId + int petId , @AsFormField() String name, @@ -86,9 +86,9 @@ class PetApi extends _$PetApiClient implements ApiClient { /// uploads an image /// /// - @PostReq(path: "/pet/:petId/uploadImage", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @PostReq(path: '/pet/:petId/uploadImage') Future uploadFile( - @PathParam("petId") int 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 b0e401042756..5a360741cc07 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 @@ -19,30 +19,30 @@ class StoreApi extends _$StoreApiClient implements ApiClient { /// Delete purchase order by ID /// /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - @DeleteReq(path: "/store/order/:orderId") + @DeleteReq(path: '/store/order/:orderId') Future deleteOrder( - @PathParam("orderId") String orderId + String orderId ); /// Returns pet inventories by status /// /// Returns a map of status codes to quantities - @GetReq(path: "/store/inventory", metadata: {"auth": [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }]}) + @GetReq(path: '/store/inventory') Future> getInventory( ); /// Find purchase order by ID /// /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - @GetReq(path: "/store/order/:orderId") + @GetReq(path: '/store/order/:orderId') Future getOrderById( - @PathParam("orderId") int orderId + int orderId ); /// Place an order for a pet /// /// - @PostReq(path: "/store/order") + @PostReq(path: '/store/order') Future placeOrder( @AsJson() Order order 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 337375075c24..07e232cb5a55 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 @@ -19,7 +19,7 @@ class UserApi extends _$UserApiClient implements ApiClient { /// Create user /// /// This can only be done by the logged in user. - @PostReq(path: "/user") + @PostReq(path: '/user') Future createUser( @AsJson() User user @@ -28,7 +28,7 @@ class UserApi extends _$UserApiClient implements ApiClient { /// Creates list of users with given input array /// /// - @PostReq(path: "/user/createWithArray") + @PostReq(path: '/user/createWithArray') Future createUsersWithArrayInput( @AsJson() List user @@ -37,7 +37,7 @@ class UserApi extends _$UserApiClient implements ApiClient { /// Creates list of users with given input array /// /// - @PostReq(path: "/user/createWithList") + @PostReq(path: '/user/createWithList') Future createUsersWithListInput( @AsJson() List user @@ -46,23 +46,23 @@ class UserApi extends _$UserApiClient implements ApiClient { /// Delete user /// /// This can only be done by the logged in user. - @DeleteReq(path: "/user/:username") + @DeleteReq(path: '/user/:username') Future deleteUser( - @PathParam("username") String username + String username ); /// Get user by user name /// /// - @GetReq(path: "/user/:username") + @GetReq(path: '/user/:username') Future getUserByName( - @PathParam("username") String username + String username ); /// Logs user into the system /// /// - @GetReq(path: "/user/login") + @GetReq(path: '/user/login') Future loginUser( @QueryParam("username") String username, @@ -73,16 +73,16 @@ class UserApi extends _$UserApiClient implements ApiClient { /// Logs out current logged in user session /// /// - @GetReq(path: "/user/logout") + @GetReq(path: '/user/logout') Future logoutUser( ); /// Updated user /// /// This can only be done by the logged in user. - @PutReq(path: "/user/:username") + @PutReq(path: '/user/:username') Future updateUser( - @PathParam("username") String 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 001a842f966d..78403ea6507a 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.5.4' - jaguar_serializer: '^2.2.2' + jaguar_retrofit: '^2.4.1' + jaguar_serializer: '^2.2.0' dev_dependencies: - jaguar_retrofit_gen: '^2.5.2' + jaguar_retrofit_gen: '^2.4.2' 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/swagger/.analysis_options b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.analysis_options deleted file mode 100644 index 518eb901a6ff..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.analysis_options +++ /dev/null @@ -1,2 +0,0 @@ -analyzer: - strong-mode: true \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.gitignore b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.gitignore deleted file mode 100644 index 7c2804416498..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -# See https://www.dartlang.org/tools/private-files.html - -# Files and directories created by pub -.buildlog -.packages -.project -.pub/ -build/ -**/packages/ - -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json - -# Directory created by dartdoc -doc/api/ - -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.swagger-codegen-ignore b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.swagger-codegen-ignore deleted file mode 100644 index c5fa491b4c55..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.swagger-codegen/VERSION b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.swagger-codegen/VERSION deleted file mode 100644 index 855ff9501eb8..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/README.md b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/README.md deleted file mode 100644 index 764e1a486078..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/README.md +++ /dev/null @@ -1,125 +0,0 @@ -# swagger -This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - -This Dart package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: 1.0.0 -- Build date: 2018-09-07T19:52:26.806+02:00 -- Build package: io.swagger.codegen.languages.DartJaguarClientCodegen - -## Requirements - -Dart 2 or later OR Flutter 0.7.0 or later - -## Installation & Usage - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -``` -name: swagger -version: 1.0.0 -description: Swagger API client -dependencies: - swagger: - git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - version: 'any' -``` - -### Local -To use the package in your local drive, please include the following in pubspec.yaml -``` -dependencies: - swagger: - path: /path/to/swagger -``` - -## Tests - -TODO - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:swagger/api.dart'; - -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -final swaggerGen = SwaggerGen(); -var api_instance = swaggerGen.getPetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.addPet(body); -} catch (e) { - print("Exception when calling PetApi->addPet: $e\n"); -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID -*PetApi* | [**updatePet**](docs//PetApi.md#updatepet) | **Put** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs//UserApi.md#createuser) | **Post** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user -*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name -*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **Put** /user/:username | Updated user - - -## Documentation For Models - - - [Amount](docs//Amount.md) - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Currency](docs//Currency.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [User](docs//User.md) - - -## Documentation For Authorization - - -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - -apiteam@swagger.io - - diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Amount.md b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Amount.md deleted file mode 100644 index 12c2fc20a7a7..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Amount.md +++ /dev/null @@ -1,16 +0,0 @@ -# swagger.model.Amount - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **double** | some description | [default to null] -**currency** | [**Currency**](Currency.md) | | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/ApiResponse.md b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/ApiResponse.md deleted file mode 100644 index 7bc0c834d782..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/ApiResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# swagger.model.ApiResponse - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] [default to null] -**type** | **String** | | [optional] [default to null] -**message** | **String** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Category.md b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Category.md deleted file mode 100644 index 3f5d01c5e1ce..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Category.md +++ /dev/null @@ -1,16 +0,0 @@ -# swagger.model.Category - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Currency.md b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Currency.md deleted file mode 100644 index 0b25bce60f58..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Currency.md +++ /dev/null @@ -1,14 +0,0 @@ -# swagger.model.Currency - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Order.md b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Order.md deleted file mode 100644 index c076322a76e3..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Order.md +++ /dev/null @@ -1,20 +0,0 @@ -# swagger.model.Order - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**petId** | **int** | | [optional] [default to null] -**quantity** | **int** | | [optional] [default to null] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] -**status** | **String** | Order Status | [optional] [default to null] -**complete** | **bool** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Pet.md b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Pet.md deleted file mode 100644 index a9e12476aafe..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Pet.md +++ /dev/null @@ -1,20 +0,0 @@ -# swagger.model.Pet - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**category** | [**Category**](Category.md) | | [optional] [default to null] -**name** | **String** | | [default to null] -**photoUrls** | **List<String>** | | [default to const []] -**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to const []] -**status** | **String** | pet status in the store | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/PetApi.md b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/PetApi.md deleted file mode 100644 index 91fb5270942c..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/PetApi.md +++ /dev/null @@ -1,389 +0,0 @@ -# swagger.api.PetApi - -## Load the API package -```dart -import 'package:swagger/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetApi.md#addPet) | **Post** /pet | Add a new pet to the store -[**deletePet**](PetApi.md#deletePet) | **Delete** /pet/:petId | Deletes a pet -[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **Get** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetApi.md#findPetsByTags) | **Get** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetApi.md#getPetById) | **Get** /pet/:petId | Find pet by ID -[**updatePet**](PetApi.md#updatePet) | **Put** /pet | Update an existing pet -[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **Post** /pet/:petId | Updates a pet in the store with form data -[**uploadFile**](PetApi.md#uploadFile) | **Post** /pet/:petId/uploadImage | uploads an image - - -# **addPet** -> addPet(body) - -Add a new pet to the store - - - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.addPet(body); -} catch (e) { - print("Exception when calling PetApi->addPet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - - - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var petId = 789; // int | Pet id to delete -var apiKey = apiKey_example; // String | - -try { - api_instance.deletePet(petId, apiKey); -} catch (e) { - print("Exception when calling PetApi->deletePet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| Pet id to delete | - **apiKey** | **String**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -> List findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var status = []; // List | Status values that need to be considered for filter - -try { - var result = api_instance.findPetsByStatus(status); - print(result); -} catch (e) { - print("Exception when calling PetApi->findPetsByStatus: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | - -### Return type - -[**List**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -> List findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var tags = []; // List | Tags to filter by - -try { - var result = api_instance.findPetsByTags(tags); - print(result); -} catch (e) { - print("Exception when calling PetApi->findPetsByTags: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | - -### Return type - -[**List**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure API key authorization: api_key -//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//swagger.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; - -var api_instance = new PetApi(); -var petId = 789; // int | ID of pet to return - -try { - var result = api_instance.getPetById(petId); - print(result); -} catch (e) { - print("Exception when calling PetApi->getPetById: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -> updatePet(body) - -Update an existing pet - - - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.updatePet(body); -} catch (e) { - print("Exception when calling PetApi->updatePet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - - - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var petId = 789; // int | ID of pet that needs to be updated -var name = name_example; // String | Updated name of the pet -var status = status_example; // String | Updated status of the pet - -try { - api_instance.updatePetWithForm(petId, name, status); -} catch (e) { - print("Exception when calling PetApi->updatePetWithForm: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - - - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var petId = 789; // int | ID of pet to update -var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server -var file = /path/to/file.txt; // MultipartFile | file to upload - -try { - var result = api_instance.uploadFile(petId, additionalMetadata, file); - print(result); -} catch (e) { - print("Exception when calling PetApi->uploadFile: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **MultipartFile**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/StoreApi.md b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/StoreApi.md deleted file mode 100644 index 4ce520a8dfb8..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/StoreApi.md +++ /dev/null @@ -1,188 +0,0 @@ -# swagger.api.StoreApi - -## Load the API package -```dart -import 'package:swagger/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **Delete** /store/order/:orderId | Delete purchase order by ID -[**getInventory**](StoreApi.md#getInventory) | **Get** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **Get** /store/order/:orderId | Find purchase order by ID -[**placeOrder**](StoreApi.md#placeOrder) | **Post** /store/order | Place an order for a pet - - -# **deleteOrder** -> deleteOrder(orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new StoreApi(); -var orderId = orderId_example; // String | ID of the order that needs to be deleted - -try { - api_instance.deleteOrder(orderId); -} catch (e) { - print("Exception when calling StoreApi->deleteOrder: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -> Map getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure API key authorization: api_key -//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//swagger.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; - -var api_instance = new StoreApi(); - -try { - var result = api_instance.getInventory(); - print(result); -} catch (e) { - print("Exception when calling StoreApi->getInventory: $e\n"); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Map** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new StoreApi(); -var orderId = 789; // int | ID of pet that needs to be fetched - -try { - var result = api_instance.getOrderById(orderId); - print(result); -} catch (e) { - print("Exception when calling StoreApi->getOrderById: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -> Order placeOrder(body) - -Place an order for a pet - - - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new StoreApi(); -var body = new Order(); // Order | order placed for purchasing the pet - -try { - var result = api_instance.placeOrder(body); - print(result); -} catch (e) { - print("Exception when calling StoreApi->placeOrder: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Tag.md b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Tag.md deleted file mode 100644 index c644f1e826ae..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/Tag.md +++ /dev/null @@ -1,16 +0,0 @@ -# swagger.model.Tag - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/User.md b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/User.md deleted file mode 100644 index d49bb37d96c5..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/User.md +++ /dev/null @@ -1,22 +0,0 @@ -# swagger.model.User - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**username** | **String** | | [optional] [default to null] -**firstName** | **String** | | [optional] [default to null] -**lastName** | **String** | | [optional] [default to null] -**email** | **String** | | [optional] [default to null] -**password** | **String** | | [optional] [default to null] -**phone** | **String** | | [optional] [default to null] -**userStatus** | **int** | User Status | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/UserApi.md b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/UserApi.md deleted file mode 100644 index 8f6261ec03dc..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/docs/UserApi.md +++ /dev/null @@ -1,359 +0,0 @@ -# swagger.api.UserApi - -## Load the API package -```dart -import 'package:swagger/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserApi.md#createUser) | **Post** /user | Create user -[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **Post** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **Post** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserApi.md#deleteUser) | **Delete** /user/:username | Delete user -[**getUserByName**](UserApi.md#getUserByName) | **Get** /user/:username | Get user by user name -[**loginUser**](UserApi.md#loginUser) | **Get** /user/login | Logs user into the system -[**logoutUser**](UserApi.md#logoutUser) | **Get** /user/logout | Logs out current logged in user session -[**updateUser**](UserApi.md#updateUser) | **Put** /user/:username | Updated user - - -# **createUser** -> createUser(body) - -Create user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var body = new User(); // User | Created user object - -try { - api_instance.createUser(body); -} catch (e) { - print("Exception when calling UserApi->createUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(body) - -Creates list of users with given input array - - - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object - -try { - api_instance.createUsersWithArrayInput(body); -} catch (e) { - print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -> createUsersWithListInput(body) - -Creates list of users with given input array - - - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object - -try { - api_instance.createUsersWithListInput(body); -} catch (e) { - print("Exception when calling UserApi->createUsersWithListInput: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var username = username_example; // String | The name that needs to be deleted - -try { - api_instance.deleteUser(username); -} catch (e) { - print("Exception when calling UserApi->deleteUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - - - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. - -try { - var result = api_instance.getUserByName(username); - print(result); -} catch (e) { - print("Exception when calling UserApi->getUserByName: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - - - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var username = username_example; // String | The user name for login -var password = password_example; // String | The password for login in clear text - -try { - var result = api_instance.loginUser(username, password); - print(result); -} catch (e) { - print("Exception when calling UserApi->loginUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - - - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); - -try { - api_instance.logoutUser(); -} catch (e) { - print("Exception when calling UserApi->logoutUser: $e\n"); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -> updateUser(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var username = username_example; // String | name that need to be deleted -var body = new User(); // User | Updated user object - -try { - api_instance.updateUser(username, body); -} catch (e) { - print("Exception when calling UserApi->updateUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/git_push.sh b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/git_push.sh deleted file mode 100644 index 83553a63a416..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api.dart deleted file mode 100644 index 27c7d4164381..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api.dart +++ /dev/null @@ -1,74 +0,0 @@ -library swagger.api; - -import 'package:jaguar_serializer/jaguar_serializer.dart'; -import 'package:jaguar_retrofit/jaguar_retrofit.dart'; - -import 'package:swagger/api/pet_api.dart'; -import 'package:swagger/api/store_api.dart'; -import 'package:swagger/api/user_api.dart'; - -import 'package:swagger/model/amount.dart'; -import 'package:swagger/model/api_response.dart'; -import 'package:swagger/model/category.dart'; -import 'package:swagger/model/currency.dart'; -import 'package:swagger/model/order.dart'; -import 'package:swagger/model/pet.dart'; -import 'package:swagger/model/tag.dart'; -import 'package:swagger/model/user.dart'; - - -final jsonJaguarRepo = JsonRepo() -..add(AmountSerializer()) -..add(ApiResponseSerializer()) -..add(CategorySerializer()) -..add(CurrencySerializer()) -..add(OrderSerializer()) -..add(PetSerializer()) -..add(TagSerializer()) -..add(UserSerializer()) -; - -final baseSwaggerPath = "http://petstore.swagger.io/v2"; -final _baseRoute = Route(baseSwaggerPath); - -class SwaggerGen { - final List interceptors; - SwaggerGen({this.interceptors = const []}) { - interceptors.forEach((interceptor) { - _baseRoute.before(interceptor.before); - _baseRoute.after(interceptor.after); - }); - } - - PetApi getPetApi({Route base, SerializerRepo serializers}) { - if(base == null) { - base = _baseRoute; - } - if(serializers == null) { - serializers = jsonJaguarRepo; - } - return PetApi(base: base, serializers: serializers); - } - - StoreApi getStoreApi({Route base, SerializerRepo serializers}) { - if(base == null) { - base = _baseRoute; - } - if(serializers == null) { - serializers = jsonJaguarRepo; - } - return StoreApi(base: base, serializers: serializers); - } - - UserApi getUserApi({Route base, SerializerRepo serializers}) { - if(base == null) { - base = _baseRoute; - } - if(serializers == null) { - serializers = jsonJaguarRepo; - } - return UserApi(base: base, serializers: serializers); - } - - -} \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/pet_api.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/pet_api.dart deleted file mode 100644 index 2489ef8b5c32..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/pet_api.dart +++ /dev/null @@ -1,99 +0,0 @@ -import 'package:jaguar_retrofit/annotations/annotations.dart'; -import 'package:jaguar_retrofit/jaguar_retrofit.dart'; -import 'package:jaguar_serializer/jaguar_serializer.dart'; -import 'package:jaguar_serializer/src/repo/repo.dart'; -import 'dart:async'; - -import 'package:swagger/model/pet.dart'; -import 'package:swagger/model/api_response.dart'; - - -part 'pet_api.jretro.dart'; - -@GenApiClient() -class PetApi extends _$PetApiClient implements ApiClient { - final Route base; - final SerializerRepo serializers; - - PetApi({this.base, this.serializers}); - - /// Add a new pet to the store - /// - /// - @PostReq(path: '/pet') - Future addPet( - - @AsJson() Pet body - ); - - /// Deletes a pet - /// - /// - @DeleteReq(path: '/pet/:petId') - Future deletePet( - int petId - , - @Header("api_key") String apiKey - ); - - /// Finds Pets by status - /// - /// Multiple status values can be provided with comma separated strings - @GetReq(path: '/pet/findByStatus') - Future> findPetsByStatus( - - @QueryParam("status") List status - ); - - /// Finds Pets by tags - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - @GetReq(path: '/pet/findByTags') - Future> findPetsByTags( - - @QueryParam("tags") List tags - ); - - /// Find pet by ID - /// - /// Returns a single pet - @GetReq(path: '/pet/:petId') - Future getPetById( - int petId - ); - - /// Update an existing pet - /// - /// - @PutReq(path: '/pet') - Future updatePet( - - @AsJson() Pet body - ); - - /// Updates a pet in the store with form data - /// - /// - @PostReq(path: '/pet/:petId') - Future updatePetWithForm( - int petId - , - @AsFormField() String name, - - @AsFormField() String status - ); - - /// uploads an image - /// - /// - @PostReq(path: '/pet/:petId/uploadImage') - Future uploadFile( - int petId - , - @AsMultipartField() String additionalMetadata, - - @AsMultipartField() MultipartFile file - ); - - -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/pet_api.jretro.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/pet_api.jretro.dart deleted file mode 100644 index cfd3ef25d990..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/pet_api.jretro.dart +++ /dev/null @@ -1,70 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'pet_api.dart'; - -// ************************************************************************** -// JaguarHttpGenerator -// ************************************************************************** - -abstract class _$PetApiClient implements ApiClient { - final String basePath = ""; - Future addPet(Pet body) async { - var req = base.post.path(basePath).path("/pet").json(serializers.to(body)); - await req.go(); - } - - Future deletePet(int petId, String apiKey) async { - var req = base.delete - .path(basePath) - .path("/pet/:petId") - .pathParams("petId", petId) - .header("api_key", apiKey); - await req.go(); - } - - Future> findPetsByStatus(List status) async { - var req = base.get - .path(basePath) - .path("/pet/findByStatus") - .query("status", status); - return req.list(convert: serializers.oneFrom); - } - - Future> findPetsByTags(List tags) async { - var req = - base.get.path(basePath).path("/pet/findByTags").query("tags", tags); - return req.list(convert: serializers.oneFrom); - } - - Future getPetById(int petId) async { - var req = - base.get.path(basePath).path("/pet/:petId").pathParams("petId", petId); - return req.one(convert: serializers.oneFrom); - } - - Future updatePet(Pet body) async { - var req = base.put.path(basePath).path("/pet").json(serializers.to(body)); - await req.go(); - } - - Future updatePetWithForm(int petId, String name, String status) async { - var req = base.post - .path(basePath) - .path("/pet/:petId") - .pathParams("petId", petId) - .urlEncodedFormField(name, name) - .urlEncodedFormField(status, status); - await req.go(); - } - - Future uploadFile( - int petId, String additionalMetadata, MultipartFile file) async { - var req = base.post - .path(basePath) - .path("/pet/:petId/uploadImage") - .pathParams("petId", petId) - .multipart({"additionalMetadata": additionalMetadata}).multipart( - {"file": file}); - return req.one(convert: serializers.oneFrom); - } -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/store_api.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/store_api.dart deleted file mode 100644 index 1d120cdd6454..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/store_api.dart +++ /dev/null @@ -1,52 +0,0 @@ -import 'package:jaguar_retrofit/annotations/annotations.dart'; -import 'package:jaguar_retrofit/jaguar_retrofit.dart'; -import 'package:jaguar_serializer/jaguar_serializer.dart'; -import 'package:jaguar_serializer/src/repo/repo.dart'; -import 'dart:async'; - -import 'package:swagger/model/order.dart'; - - -part 'store_api.jretro.dart'; - -@GenApiClient() -class StoreApi extends _$StoreApiClient implements ApiClient { - final Route base; - final SerializerRepo serializers; - - StoreApi({this.base, this.serializers}); - - /// Delete purchase order by ID - /// - /// 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 - ); - - /// Returns pet inventories by status - /// - /// Returns a map of status codes to quantities - @GetReq(path: '/store/inventory') - Future> getInventory( - ); - - /// Find purchase order by ID - /// - /// 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 - ); - - /// Place an order for a pet - /// - /// - @PostReq(path: '/store/order') - Future placeOrder( - - @AsJson() Order body - ); - - -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/store_api.jretro.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/store_api.jretro.dart deleted file mode 100644 index 50bdba4cef7a..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/store_api.jretro.dart +++ /dev/null @@ -1,39 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'store_api.dart'; - -// ************************************************************************** -// JaguarHttpGenerator -// ************************************************************************** - -abstract class _$StoreApiClient implements ApiClient { - final String basePath = ""; - Future deleteOrder(String orderId) async { - var req = base.delete - .path(basePath) - .path("/store/order/:orderId") - .pathParams("orderId", orderId); - await req.go(); - } - - Future> getInventory() async { - var req = base.get.path(basePath).path("/store/inventory"); - return serializers.from(await req.go().body); - } - - Future getOrderById(int orderId) async { - var req = base.get - .path(basePath) - .path("/store/order/:orderId") - .pathParams("orderId", orderId); - return req.one(convert: serializers.oneFrom); - } - - Future placeOrder(Order body) async { - var req = base.post - .path(basePath) - .path("/store/order") - .json(serializers.to(body)); - return req.one(convert: serializers.oneFrom); - } -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/user_api.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/user_api.dart deleted file mode 100644 index 93ef7f77c4d1..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/user_api.dart +++ /dev/null @@ -1,91 +0,0 @@ -import 'package:jaguar_retrofit/annotations/annotations.dart'; -import 'package:jaguar_retrofit/jaguar_retrofit.dart'; -import 'package:jaguar_serializer/jaguar_serializer.dart'; -import 'package:jaguar_serializer/src/repo/repo.dart'; -import 'dart:async'; - -import 'package:swagger/model/user.dart'; - - -part 'user_api.jretro.dart'; - -@GenApiClient() -class UserApi extends _$UserApiClient implements ApiClient { - final Route base; - final SerializerRepo serializers; - - UserApi({this.base, this.serializers}); - - /// Create user - /// - /// This can only be done by the logged in user. - @PostReq(path: '/user') - Future createUser( - - @AsJson() User body - ); - - /// Creates list of users with given input array - /// - /// - @PostReq(path: '/user/createWithArray') - Future createUsersWithArrayInput( - - @AsJson() List body - ); - - /// Creates list of users with given input array - /// - /// - @PostReq(path: '/user/createWithList') - Future createUsersWithListInput( - - @AsJson() List body - ); - - /// Delete user - /// - /// This can only be done by the logged in user. - @DeleteReq(path: '/user/:username') - Future deleteUser( - String username - ); - - /// Get user by user name - /// - /// - @GetReq(path: '/user/:username') - Future getUserByName( - String username - ); - - /// Logs user into the system - /// - /// - @GetReq(path: '/user/login') - Future loginUser( - - @QueryParam("username") String username, - - @QueryParam("password") String password - ); - - /// Logs out current logged in user session - /// - /// - @GetReq(path: '/user/logout') - Future logoutUser( - ); - - /// Updated user - /// - /// This can only be done by the logged in user. - @PutReq(path: '/user/:username') - Future updateUser( - String username - , - @AsJson() User body - ); - - -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/user_api.jretro.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/user_api.jretro.dart deleted file mode 100644 index 31f695eb1027..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/api/user_api.jretro.dart +++ /dev/null @@ -1,70 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'user_api.dart'; - -// ************************************************************************** -// JaguarHttpGenerator -// ************************************************************************** - -abstract class _$UserApiClient implements ApiClient { - final String basePath = ""; - Future createUser(User body) async { - var req = base.post.path(basePath).path("/user").json(serializers.to(body)); - await req.go(); - } - - Future createUsersWithArrayInput(List body) async { - var req = base.post - .path(basePath) - .path("/user/createWithArray") - .json(serializers.to(body)); - await req.go(); - } - - Future createUsersWithListInput(List body) async { - var req = base.post - .path(basePath) - .path("/user/createWithList") - .json(serializers.to(body)); - await req.go(); - } - - Future deleteUser(String username) async { - var req = base.delete - .path(basePath) - .path("/user/:username") - .pathParams("username", username); - await req.go(); - } - - Future getUserByName(String username) async { - var req = base.get - .path(basePath) - .path("/user/:username") - .pathParams("username", username); - return req.one(convert: serializers.oneFrom); - } - - Future loginUser(String username, String password) async { - var req = base.get - .path(basePath) - .path("/user/login") - .query("username", username) - .query("password", password); - return req.one(convert: serializers.oneFrom); - } - - Future logoutUser() async { - var req = base.get.path(basePath).path("/user/logout"); - await req.go(); - } - - Future updateUser(String username, User body) async { - var req = base.put - .path(basePath) - .path("/user/:username") - .pathParams("username", username) - .json(serializers.to(body)); - await req.go(); - } -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/amount.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/amount.dart deleted file mode 100644 index e701e966bf0d..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/amount.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -import 'package:swagger/model/currency.dart'; -part 'amount.jser.dart'; - -class Amount { - /* some description */ - final double value; - // range from 0.01 to 1000000000000000// - final Currency currency; - - - Amount( - - -{ - - this.value = null, - this.currency = null - } - ); - - @override - String toString() { - return 'Amount[value=$value, currency=$currency, ]'; - } -} - -@GenSerializer() -class AmountSerializer extends Serializer with _$AmountSerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/amount.jser.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/amount.jser.dart deleted file mode 100644 index 9c03e8a62d49..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/amount.jser.dart +++ /dev/null @@ -1,31 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'amount.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$AmountSerializer implements Serializer { - Serializer __currencySerializer; - Serializer get _currencySerializer => - __currencySerializer ??= new CurrencySerializer(); - @override - Map toMap(Amount model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'value', model.value); - setMapValue(ret, 'currency', _currencySerializer.toMap(model.currency)); - return ret; - } - - @override - Amount fromMap(Map map) { - if (map == null) return null; - final obj = new Amount( - value: map['value'] as double ?? getJserDefault('value'), - currency: _currencySerializer.fromMap(map['currency'] as Map) ?? - getJserDefault('currency')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/api_response.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/api_response.dart deleted file mode 100644 index 2b9fa763b009..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/api_response.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -part 'api_response.jser.dart'; - -class ApiResponse { - - final int code; - - final String type; - - final String message; - - - ApiResponse( - - -{ - this.code = null, - this.type = null, - this.message = null - - } - ); - - @override - String toString() { - return 'ApiResponse[code=$code, type=$type, message=$message, ]'; - } -} - -@GenSerializer() -class ApiResponseSerializer extends Serializer with _$ApiResponseSerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/api_response.jser.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/api_response.jser.dart deleted file mode 100644 index b4b6c090975c..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/api_response.jser.dart +++ /dev/null @@ -1,29 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'api_response.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$ApiResponseSerializer implements Serializer { - @override - Map toMap(ApiResponse model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'code', model.code); - setMapValue(ret, 'type', model.type); - setMapValue(ret, 'message', model.message); - return ret; - } - - @override - ApiResponse fromMap(Map map) { - if (map == null) return null; - final obj = new ApiResponse( - code: map['code'] as int ?? getJserDefault('code'), - type: map['type'] as String ?? getJserDefault('type'), - message: map['message'] as String ?? getJserDefault('message')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/category.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/category.dart deleted file mode 100644 index 2f5e7bd9c50f..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/category.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -part 'category.jser.dart'; - -class Category { - - final int id; - - final String name; - - - Category( - - -{ - this.id = null, - this.name = null - - } - ); - - @override - String toString() { - return 'Category[id=$id, name=$name, ]'; - } -} - -@GenSerializer() -class CategorySerializer extends Serializer with _$CategorySerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/category.jser.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/category.jser.dart deleted file mode 100644 index 763bcd3dd6e2..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/category.jser.dart +++ /dev/null @@ -1,27 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'category.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$CategorySerializer implements Serializer { - @override - Map toMap(Category model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'id', model.id); - setMapValue(ret, 'name', model.name); - return ret; - } - - @override - Category fromMap(Map map) { - if (map == null) return null; - final obj = new Category( - id: map['id'] as int ?? getJserDefault('id'), - name: map['name'] as String ?? getJserDefault('name')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/currency.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/currency.dart deleted file mode 100644 index 9a5825e52d55..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/currency.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -part 'currency.jser.dart'; - -class Currency { - - - Currency( - - - - ); - - @override - String toString() { - return 'Currency[]'; - } -} - -@GenSerializer() -class CurrencySerializer extends Serializer with _$CurrencySerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/currency.jser.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/currency.jser.dart deleted file mode 100644 index 6bc06bc69bc0..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/currency.jser.dart +++ /dev/null @@ -1,23 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'currency.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$CurrencySerializer implements Serializer { - @override - Map toMap(Currency model) { - if (model == null) return null; - Map ret = {}; - return ret; - } - - @override - Currency fromMap(Map map) { - if (map == null) return null; - final obj = new Currency(); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/order.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/order.dart deleted file mode 100644 index 46a7a839b3b0..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/order.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -part 'order.jser.dart'; - -class Order { - - final int id; - - final int petId; - - final int quantity; - - final DateTime shipDate; - /* Order Status */ - final String status; - //enum statusEnum { placed, approved, delivered, }; - final bool complete; - - - Order( - - -{ - this.id = null, - this.petId = null, - this.quantity = null, - this.shipDate = null, - this.status = null, - this.complete = null - - } - ); - - @override - String toString() { - return 'Order[id=$id, petId=$petId, quantity=$quantity, shipDate=$shipDate, status=$status, complete=$complete, ]'; - } -} - -@GenSerializer() -class OrderSerializer extends Serializer with _$OrderSerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/order.jser.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/order.jser.dart deleted file mode 100644 index 52e5d7a01bad..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/order.jser.dart +++ /dev/null @@ -1,37 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'order.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$OrderSerializer implements Serializer { - @override - Map toMap(Order model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'id', model.id); - setMapValue(ret, 'petId', model.petId); - setMapValue(ret, 'quantity', model.quantity); - setMapValue( - ret, 'shipDate', dateTimeUtcProcessor.serialize(model.shipDate)); - setMapValue(ret, 'status', model.status); - setMapValue(ret, 'complete', model.complete); - return ret; - } - - @override - Order fromMap(Map map) { - if (map == null) return null; - final obj = new Order( - id: map['id'] as int ?? getJserDefault('id'), - petId: map['petId'] as int ?? getJserDefault('petId'), - quantity: map['quantity'] as int ?? getJserDefault('quantity'), - shipDate: dateTimeUtcProcessor.deserialize(map['shipDate'] as String) ?? - getJserDefault('shipDate'), - status: map['status'] as String ?? getJserDefault('status'), - complete: map['complete'] as bool ?? getJserDefault('complete')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/pet.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/pet.dart deleted file mode 100644 index 0c1d274b8b4a..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/pet.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -import 'package:swagger/model/tag.dart'; -import 'package:swagger/model/category.dart'; -part 'pet.jser.dart'; - -class Pet { - - final int id; - - final Category category; - - final String name; - - final List photoUrls; - - final List tags; - /* pet status in the store */ - final String status; - //enum statusEnum { available, pending, sold, }; - - Pet( - - -{ - this.id = null, - this.category = null, - - this.name = null, - this.photoUrls = const [], this.tags = const [], - this.status = null - - } - ); - - @override - String toString() { - return 'Pet[id=$id, category=$category, name=$name, photoUrls=$photoUrls, tags=$tags, status=$status, ]'; - } -} - -@GenSerializer() -class PetSerializer extends Serializer with _$PetSerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/pet.jser.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/pet.jser.dart deleted file mode 100644 index ce4f22f96865..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/pet.jser.dart +++ /dev/null @@ -1,47 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'pet.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$PetSerializer implements Serializer { - Serializer __categorySerializer; - Serializer get _categorySerializer => - __categorySerializer ??= new CategorySerializer(); - Serializer __tagSerializer; - Serializer get _tagSerializer => __tagSerializer ??= new TagSerializer(); - @override - Map toMap(Pet model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'id', model.id); - setMapValue(ret, 'category', _categorySerializer.toMap(model.category)); - setMapValue(ret, 'name', model.name); - setMapValue(ret, 'photoUrls', - codeIterable(model.photoUrls, (val) => val as String)); - setMapValue(ret, 'tags', - codeIterable(model.tags, (val) => _tagSerializer.toMap(val as Tag))); - setMapValue(ret, 'status', model.status); - return ret; - } - - @override - Pet fromMap(Map map) { - if (map == null) return null; - final obj = new Pet( - id: map['id'] as int ?? getJserDefault('id'), - category: _categorySerializer.fromMap(map['category'] as Map) ?? - getJserDefault('category'), - name: map['name'] as String ?? getJserDefault('name'), - photoUrls: codeIterable( - map['photoUrls'] as Iterable, (val) => val as String) ?? - getJserDefault('photoUrls'), - tags: codeIterable(map['tags'] as Iterable, - (val) => _tagSerializer.fromMap(val as Map)) ?? - getJserDefault('tags'), - status: map['status'] as String ?? getJserDefault('status')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/tag.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/tag.dart deleted file mode 100644 index 7b294b3008b5..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/tag.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -part 'tag.jser.dart'; - -class Tag { - - final int id; - - final String name; - - - Tag( - - -{ - this.id = null, - this.name = null - - } - ); - - @override - String toString() { - return 'Tag[id=$id, name=$name, ]'; - } -} - -@GenSerializer() -class TagSerializer extends Serializer with _$TagSerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/tag.jser.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/tag.jser.dart deleted file mode 100644 index cdb14e1783ee..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/tag.jser.dart +++ /dev/null @@ -1,27 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'tag.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$TagSerializer implements Serializer { - @override - Map toMap(Tag model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'id', model.id); - setMapValue(ret, 'name', model.name); - return ret; - } - - @override - Tag fromMap(Map map) { - if (map == null) return null; - final obj = new Tag( - id: map['id'] as int ?? getJserDefault('id'), - name: map['name'] as String ?? getJserDefault('name')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/user.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/user.dart deleted file mode 100644 index fddc756616a1..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/user.dart +++ /dev/null @@ -1,49 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -part 'user.jser.dart'; - -class User { - - final int id; - - final String username; - - final String firstName; - - final String lastName; - - final String email; - - final String password; - - final String phone; - /* User Status */ - final int userStatus; - - - User( - - -{ - this.id = null, - this.username = null, - this.firstName = null, - this.lastName = null, - this.email = null, - this.password = null, - this.phone = null, - this.userStatus = null - - } - ); - - @override - String toString() { - return 'User[id=$id, username=$username, firstName=$firstName, lastName=$lastName, email=$email, password=$password, phone=$phone, userStatus=$userStatus, ]'; - } -} - -@GenSerializer() -class UserSerializer extends Serializer with _$UserSerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/user.jser.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/user.jser.dart deleted file mode 100644 index 0eced9472d04..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/lib/model/user.jser.dart +++ /dev/null @@ -1,39 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'user.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$UserSerializer implements Serializer { - @override - Map toMap(User model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'id', model.id); - setMapValue(ret, 'username', model.username); - setMapValue(ret, 'firstName', model.firstName); - setMapValue(ret, 'lastName', model.lastName); - setMapValue(ret, 'email', model.email); - setMapValue(ret, 'password', model.password); - setMapValue(ret, 'phone', model.phone); - setMapValue(ret, 'userStatus', model.userStatus); - return ret; - } - - @override - User fromMap(Map map) { - if (map == null) return null; - final obj = new User( - id: map['id'] as int ?? getJserDefault('id'), - username: map['username'] as String ?? getJserDefault('username'), - firstName: map['firstName'] as String ?? getJserDefault('firstName'), - lastName: map['lastName'] as String ?? getJserDefault('lastName'), - email: map['email'] as String ?? getJserDefault('email'), - password: map['password'] as String ?? getJserDefault('password'), - phone: map['phone'] as String ?? getJserDefault('phone'), - userStatus: map['userStatus'] as int ?? getJserDefault('userStatus')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/pubspec.yaml b/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/pubspec.yaml deleted file mode 100644 index 697b383f0f17..000000000000 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/swagger/pubspec.yaml +++ /dev/null @@ -1,12 +0,0 @@ -name: swagger -version: 1.0.0 -description: Swagger API client -environment: - sdk: ">=2.0.0 <3.0.0" -dependencies: - jaguar_retrofit: '^2.4.1' - jaguar_serializer: '^2.2.0' -dev_dependencies: - jaguar_retrofit_gen: '^2.4.2' - 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 c0108e390f6f..98651e2cf236 100644 --- a/samples/client/petstore/dart-jaguar/openapi/lib/api.dart +++ b/samples/client/petstore/dart-jaguar/openapi/lib/api.dart @@ -1,11 +1,7 @@ library openapi.api; -import 'package:http/http.dart'; import 'package:jaguar_serializer/jaguar_serializer.dart'; import 'package:jaguar_retrofit/jaguar_retrofit.dart'; -import 'package:openapi/auth/api_key_auth.dart'; -import 'package:openapi/auth/basic_auth.dart'; -import 'package:openapi/auth/oauth.dart'; import 'package:openapi/api/pet_api.dart'; import 'package:openapi/api/store_api.dart'; @@ -28,51 +24,18 @@ final jsonJaguarRepo = JsonRepo() ..add(UserSerializer()) ; -final _defaultInterceptors = [OAuthInterceptor(), BasicAuthInterceptor(), ApiKeyAuthInterceptor()]; +final baseSwaggerPath = "http://petstore.swagger.io/v2"; +final _baseRoute = Route(baseSwaggerPath); -class JaguarApiGen { - List interceptors; - 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) - */ - JaguarApiGen({List interceptors, bool overrideInterceptors = false, String baseUrl}) { - _baseRoute = Route(baseUrl ?? basePath).withClient(globalClient ?? IOClient()); - if(interceptors == null) { - this.interceptors = _defaultInterceptors; - } - else if(overrideInterceptors){ - this.interceptors = interceptors; - } - else { - this.interceptors = List.from(_defaultInterceptors)..addAll(interceptors); - } - - this.interceptors.forEach((interceptor) { +class SwaggerGen { + final List interceptors; + SwaggerGen({this.interceptors = const []}) { + interceptors.forEach((interceptor) { _baseRoute.before(interceptor.before); _baseRoute.after(interceptor.after); }); } - void setOAuthToken(String name, String token) { - (_defaultInterceptors[0] as OAuthInterceptor).tokens[name] = token; - } - - void setBasicAuth(String name, String username, String password) { - (_defaultInterceptors[1] as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); - } - - void setApiKey(String name, String apiKey) { - (_defaultInterceptors[2] as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; - } - - - /** - * 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; @@ -83,11 +46,6 @@ class JaguarApiGen { return PetApi(base: base, serializers: serializers); } - - /** - * 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; @@ -98,11 +56,6 @@ class JaguarApiGen { return StoreApi(base: base, serializers: serializers); } - - /** - * 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 +67,4 @@ class JaguarApiGen { } -} +} \ 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 ae5f7e9c158e..6b7f806abe35 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 @@ -20,7 +20,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Add a new pet to the store /// /// - @PostReq(path: "/pet", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @PostReq(path: '/pet') Future addPet( @AsJson() Pet pet @@ -29,9 +29,9 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Deletes a pet /// /// - @DeleteReq(path: "/pet/:petId", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @DeleteReq(path: '/pet/:petId') Future deletePet( - @PathParam("petId") int petId + int petId , @Header("api_key") String apiKey ); @@ -39,7 +39,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Finds Pets by status /// /// Multiple status values can be provided with comma separated strings - @GetReq(path: "/pet/findByStatus", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @GetReq(path: '/pet/findByStatus') Future> findPetsByStatus( @QueryParam("status") List status @@ -48,7 +48,7 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Finds Pets by tags /// /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - @GetReq(path: "/pet/findByTags", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @GetReq(path: '/pet/findByTags') Future> findPetsByTags( @QueryParam("tags") List tags @@ -57,15 +57,15 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Find pet by ID /// /// Returns a single pet - @GetReq(path: "/pet/:petId", metadata: {"auth": [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }]}) + @GetReq(path: '/pet/:petId') Future getPetById( - @PathParam("petId") int petId + int petId ); /// Update an existing pet /// /// - @PutReq(path: "/pet", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @PutReq(path: '/pet') Future updatePet( @AsJson() Pet pet @@ -74,9 +74,9 @@ class PetApi extends _$PetApiClient implements ApiClient { /// Updates a pet in the store with form data /// /// - @PostReq(path: "/pet/:petId", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @PostReq(path: '/pet/:petId') Future updatePetWithForm( - @PathParam("petId") int petId + int petId , @AsFormField() String name, @@ -86,9 +86,9 @@ class PetApi extends _$PetApiClient implements ApiClient { /// uploads an image /// /// - @PostReq(path: "/pet/:petId/uploadImage", metadata: {"auth": [ {"type": "oauth2", "name": "petstore_auth" }]}) + @PostReq(path: '/pet/:petId/uploadImage') Future uploadFile( - @PathParam("petId") int 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 b0e401042756..5a360741cc07 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 @@ -19,30 +19,30 @@ class StoreApi extends _$StoreApiClient implements ApiClient { /// Delete purchase order by ID /// /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - @DeleteReq(path: "/store/order/:orderId") + @DeleteReq(path: '/store/order/:orderId') Future deleteOrder( - @PathParam("orderId") String orderId + String orderId ); /// Returns pet inventories by status /// /// Returns a map of status codes to quantities - @GetReq(path: "/store/inventory", metadata: {"auth": [ {"type": "apiKey", "name": "api_key", "keyName": "api_key", "where": "header" }]}) + @GetReq(path: '/store/inventory') Future> getInventory( ); /// Find purchase order by ID /// /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - @GetReq(path: "/store/order/:orderId") + @GetReq(path: '/store/order/:orderId') Future getOrderById( - @PathParam("orderId") int orderId + int orderId ); /// Place an order for a pet /// /// - @PostReq(path: "/store/order") + @PostReq(path: '/store/order') Future placeOrder( @AsJson() Order order 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 337375075c24..07e232cb5a55 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 @@ -19,7 +19,7 @@ class UserApi extends _$UserApiClient implements ApiClient { /// Create user /// /// This can only be done by the logged in user. - @PostReq(path: "/user") + @PostReq(path: '/user') Future createUser( @AsJson() User user @@ -28,7 +28,7 @@ class UserApi extends _$UserApiClient implements ApiClient { /// Creates list of users with given input array /// /// - @PostReq(path: "/user/createWithArray") + @PostReq(path: '/user/createWithArray') Future createUsersWithArrayInput( @AsJson() List user @@ -37,7 +37,7 @@ class UserApi extends _$UserApiClient implements ApiClient { /// Creates list of users with given input array /// /// - @PostReq(path: "/user/createWithList") + @PostReq(path: '/user/createWithList') Future createUsersWithListInput( @AsJson() List user @@ -46,23 +46,23 @@ class UserApi extends _$UserApiClient implements ApiClient { /// Delete user /// /// This can only be done by the logged in user. - @DeleteReq(path: "/user/:username") + @DeleteReq(path: '/user/:username') Future deleteUser( - @PathParam("username") String username + String username ); /// Get user by user name /// /// - @GetReq(path: "/user/:username") + @GetReq(path: '/user/:username') Future getUserByName( - @PathParam("username") String username + String username ); /// Logs user into the system /// /// - @GetReq(path: "/user/login") + @GetReq(path: '/user/login') Future loginUser( @QueryParam("username") String username, @@ -73,16 +73,16 @@ class UserApi extends _$UserApiClient implements ApiClient { /// Logs out current logged in user session /// /// - @GetReq(path: "/user/logout") + @GetReq(path: '/user/logout') Future logoutUser( ); /// Updated user /// /// This can only be done by the logged in user. - @PutReq(path: "/user/:username") + @PutReq(path: '/user/:username') Future updateUser( - @PathParam("username") String 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 001a842f966d..78403ea6507a 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.5.4' - jaguar_serializer: '^2.2.2' + jaguar_retrofit: '^2.4.1' + jaguar_serializer: '^2.2.0' dev_dependencies: - jaguar_retrofit_gen: '^2.5.2' + jaguar_retrofit_gen: '^2.4.2' 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/swagger/.analysis_options b/samples/client/petstore/dart-jaguar/swagger/.analysis_options deleted file mode 100644 index 518eb901a6ff..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/.analysis_options +++ /dev/null @@ -1,2 +0,0 @@ -analyzer: - strong-mode: true \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/swagger/.gitignore b/samples/client/petstore/dart-jaguar/swagger/.gitignore deleted file mode 100644 index 7c2804416498..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/.gitignore +++ /dev/null @@ -1,27 +0,0 @@ -# See https://www.dartlang.org/tools/private-files.html - -# Files and directories created by pub -.buildlog -.packages -.project -.pub/ -build/ -**/packages/ - -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json - -# Directory created by dartdoc -doc/api/ - -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock diff --git a/samples/client/petstore/dart-jaguar/swagger/.swagger-codegen-ignore b/samples/client/petstore/dart-jaguar/swagger/.swagger-codegen-ignore deleted file mode 100644 index c5fa491b4c55..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/.swagger-codegen-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/dart-jaguar/swagger/.swagger-codegen/VERSION b/samples/client/petstore/dart-jaguar/swagger/.swagger-codegen/VERSION deleted file mode 100644 index 855ff9501eb8..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/swagger/README.md b/samples/client/petstore/dart-jaguar/swagger/README.md deleted file mode 100644 index 7ddce0d9f7c2..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/README.md +++ /dev/null @@ -1,125 +0,0 @@ -# swagger -This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - -This Dart package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - -- API version: 1.0.0 -- Build date: 2018-09-07T19:52:25.855+02:00 -- Build package: io.swagger.codegen.languages.DartJaguarClientCodegen - -## Requirements - -Dart 2 or later OR Flutter 0.7.0 or later - -## Installation & Usage - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -``` -name: swagger -version: 1.0.0 -description: Swagger API client -dependencies: - swagger: - git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - version: 'any' -``` - -### Local -To use the package in your local drive, please include the following in pubspec.yaml -``` -dependencies: - swagger: - path: /path/to/swagger -``` - -## Tests - -TODO - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:swagger/api.dart'; - -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -final swaggerGen = SwaggerGen(); -var api_instance = swaggerGen.getPetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.addPet(body); -} catch (e) { - print("Exception when calling PetApi->addPet: $e\n"); -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs//PetApi.md#addpet) | **Post** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs//PetApi.md#deletepet) | **Delete** /pet/:petId | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs//PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs//PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs//PetApi.md#getpetbyid) | **Get** /pet/:petId | Find pet by ID -*PetApi* | [**updatePet**](docs//PetApi.md#updatepet) | **Put** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs//PetApi.md#updatepetwithform) | **Post** /pet/:petId | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs//PetApi.md#uploadfile) | **Post** /pet/:petId/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs//StoreApi.md#deleteorder) | **Delete** /store/order/:orderId | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs//StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs//StoreApi.md#getorderbyid) | **Get** /store/order/:orderId | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs//StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs//UserApi.md#createuser) | **Post** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs//UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs//UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs//UserApi.md#deleteuser) | **Delete** /user/:username | Delete user -*UserApi* | [**getUserByName**](docs//UserApi.md#getuserbyname) | **Get** /user/:username | Get user by user name -*UserApi* | [**loginUser**](docs//UserApi.md#loginuser) | **Get** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs//UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs//UserApi.md#updateuser) | **Put** /user/:username | Updated user - - -## Documentation For Models - - - [Amount](docs//Amount.md) - - [ApiResponse](docs//ApiResponse.md) - - [Category](docs//Category.md) - - [Currency](docs//Currency.md) - - [Order](docs//Order.md) - - [Pet](docs//Pet.md) - - [Tag](docs//Tag.md) - - [User](docs//User.md) - - -## Documentation For Authorization - - -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - -apiteam@swagger.io - - diff --git a/samples/client/petstore/dart-jaguar/swagger/docs/Amount.md b/samples/client/petstore/dart-jaguar/swagger/docs/Amount.md deleted file mode 100644 index 12c2fc20a7a7..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/docs/Amount.md +++ /dev/null @@ -1,16 +0,0 @@ -# swagger.model.Amount - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **double** | some description | [default to null] -**currency** | [**Currency**](Currency.md) | | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/swagger/docs/ApiResponse.md b/samples/client/petstore/dart-jaguar/swagger/docs/ApiResponse.md deleted file mode 100644 index 7bc0c834d782..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/docs/ApiResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# swagger.model.ApiResponse - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] [default to null] -**type** | **String** | | [optional] [default to null] -**message** | **String** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/swagger/docs/Category.md b/samples/client/petstore/dart-jaguar/swagger/docs/Category.md deleted file mode 100644 index 3f5d01c5e1ce..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/docs/Category.md +++ /dev/null @@ -1,16 +0,0 @@ -# swagger.model.Category - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/swagger/docs/Currency.md b/samples/client/petstore/dart-jaguar/swagger/docs/Currency.md deleted file mode 100644 index 0b25bce60f58..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/docs/Currency.md +++ /dev/null @@ -1,14 +0,0 @@ -# swagger.model.Currency - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/swagger/docs/Order.md b/samples/client/petstore/dart-jaguar/swagger/docs/Order.md deleted file mode 100644 index c076322a76e3..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/docs/Order.md +++ /dev/null @@ -1,20 +0,0 @@ -# swagger.model.Order - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**petId** | **int** | | [optional] [default to null] -**quantity** | **int** | | [optional] [default to null] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] [default to null] -**status** | **String** | Order Status | [optional] [default to null] -**complete** | **bool** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/swagger/docs/Pet.md b/samples/client/petstore/dart-jaguar/swagger/docs/Pet.md deleted file mode 100644 index a9e12476aafe..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/docs/Pet.md +++ /dev/null @@ -1,20 +0,0 @@ -# swagger.model.Pet - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**category** | [**Category**](Category.md) | | [optional] [default to null] -**name** | **String** | | [default to null] -**photoUrls** | **List<String>** | | [default to const []] -**tags** | [**List<Tag>**](Tag.md) | | [optional] [default to const []] -**status** | **String** | pet status in the store | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/swagger/docs/PetApi.md b/samples/client/petstore/dart-jaguar/swagger/docs/PetApi.md deleted file mode 100644 index 91fb5270942c..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/docs/PetApi.md +++ /dev/null @@ -1,389 +0,0 @@ -# swagger.api.PetApi - -## Load the API package -```dart -import 'package:swagger/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetApi.md#addPet) | **Post** /pet | Add a new pet to the store -[**deletePet**](PetApi.md#deletePet) | **Delete** /pet/:petId | Deletes a pet -[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **Get** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetApi.md#findPetsByTags) | **Get** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetApi.md#getPetById) | **Get** /pet/:petId | Find pet by ID -[**updatePet**](PetApi.md#updatePet) | **Put** /pet | Update an existing pet -[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **Post** /pet/:petId | Updates a pet in the store with form data -[**uploadFile**](PetApi.md#uploadFile) | **Post** /pet/:petId/uploadImage | uploads an image - - -# **addPet** -> addPet(body) - -Add a new pet to the store - - - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.addPet(body); -} catch (e) { - print("Exception when calling PetApi->addPet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - - - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var petId = 789; // int | Pet id to delete -var apiKey = apiKey_example; // String | - -try { - api_instance.deletePet(petId, apiKey); -} catch (e) { - print("Exception when calling PetApi->deletePet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| Pet id to delete | - **apiKey** | **String**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -> List findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var status = []; // List | Status values that need to be considered for filter - -try { - var result = api_instance.findPetsByStatus(status); - print(result); -} catch (e) { - print("Exception when calling PetApi->findPetsByStatus: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | - -### Return type - -[**List**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -> List findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var tags = []; // List | Tags to filter by - -try { - var result = api_instance.findPetsByTags(tags); - print(result); -} catch (e) { - print("Exception when calling PetApi->findPetsByTags: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | - -### Return type - -[**List**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure API key authorization: api_key -//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//swagger.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; - -var api_instance = new PetApi(); -var petId = 789; // int | ID of pet to return - -try { - var result = api_instance.getPetById(petId); - print(result); -} catch (e) { - print("Exception when calling PetApi->getPetById: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -> updatePet(body) - -Update an existing pet - - - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store - -try { - api_instance.updatePet(body); -} catch (e) { - print("Exception when calling PetApi->updatePet: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - - - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var petId = 789; // int | ID of pet that needs to be updated -var name = name_example; // String | Updated name of the pet -var status = status_example; // String | Updated status of the pet - -try { - api_instance.updatePetWithForm(petId, name, status); -} catch (e) { - print("Exception when calling PetApi->updatePetWithForm: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - - - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; - -var api_instance = new PetApi(); -var petId = 789; // int | ID of pet to update -var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server -var file = /path/to/file.txt; // MultipartFile | file to upload - -try { - var result = api_instance.uploadFile(petId, additionalMetadata, file); - print(result); -} catch (e) { - print("Exception when calling PetApi->uploadFile: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **MultipartFile**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/dart-jaguar/swagger/docs/StoreApi.md b/samples/client/petstore/dart-jaguar/swagger/docs/StoreApi.md deleted file mode 100644 index 4ce520a8dfb8..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/docs/StoreApi.md +++ /dev/null @@ -1,188 +0,0 @@ -# swagger.api.StoreApi - -## Load the API package -```dart -import 'package:swagger/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **Delete** /store/order/:orderId | Delete purchase order by ID -[**getInventory**](StoreApi.md#getInventory) | **Get** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **Get** /store/order/:orderId | Find purchase order by ID -[**placeOrder**](StoreApi.md#placeOrder) | **Post** /store/order | Place an order for a pet - - -# **deleteOrder** -> deleteOrder(orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new StoreApi(); -var orderId = orderId_example; // String | ID of the order that needs to be deleted - -try { - api_instance.deleteOrder(orderId); -} catch (e) { - print("Exception when calling StoreApi->deleteOrder: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -> Map getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```dart -import 'package:swagger/api.dart'; -// TODO Configure API key authorization: api_key -//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//swagger.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; - -var api_instance = new StoreApi(); - -try { - var result = api_instance.getInventory(); - print(result); -} catch (e) { - print("Exception when calling StoreApi->getInventory: $e\n"); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Map** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new StoreApi(); -var orderId = 789; // int | ID of pet that needs to be fetched - -try { - var result = api_instance.getOrderById(orderId); - print(result); -} catch (e) { - print("Exception when calling StoreApi->getOrderById: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -> Order placeOrder(body) - -Place an order for a pet - - - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new StoreApi(); -var body = new Order(); // Order | order placed for purchasing the pet - -try { - var result = api_instance.placeOrder(body); - print(result); -} catch (e) { - print("Exception when calling StoreApi->placeOrder: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/dart-jaguar/swagger/docs/Tag.md b/samples/client/petstore/dart-jaguar/swagger/docs/Tag.md deleted file mode 100644 index c644f1e826ae..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/docs/Tag.md +++ /dev/null @@ -1,16 +0,0 @@ -# swagger.model.Tag - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**name** | **String** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/swagger/docs/User.md b/samples/client/petstore/dart-jaguar/swagger/docs/User.md deleted file mode 100644 index d49bb37d96c5..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/docs/User.md +++ /dev/null @@ -1,22 +0,0 @@ -# swagger.model.User - -## Load the model package -```dart -import 'package:swagger/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] [default to null] -**username** | **String** | | [optional] [default to null] -**firstName** | **String** | | [optional] [default to null] -**lastName** | **String** | | [optional] [default to null] -**email** | **String** | | [optional] [default to null] -**password** | **String** | | [optional] [default to null] -**phone** | **String** | | [optional] [default to null] -**userStatus** | **int** | User Status | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/dart-jaguar/swagger/docs/UserApi.md b/samples/client/petstore/dart-jaguar/swagger/docs/UserApi.md deleted file mode 100644 index 8f6261ec03dc..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/docs/UserApi.md +++ /dev/null @@ -1,359 +0,0 @@ -# swagger.api.UserApi - -## Load the API package -```dart -import 'package:swagger/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserApi.md#createUser) | **Post** /user | Create user -[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **Post** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **Post** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserApi.md#deleteUser) | **Delete** /user/:username | Delete user -[**getUserByName**](UserApi.md#getUserByName) | **Get** /user/:username | Get user by user name -[**loginUser**](UserApi.md#loginUser) | **Get** /user/login | Logs user into the system -[**logoutUser**](UserApi.md#logoutUser) | **Get** /user/logout | Logs out current logged in user session -[**updateUser**](UserApi.md#updateUser) | **Put** /user/:username | Updated user - - -# **createUser** -> createUser(body) - -Create user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var body = new User(); // User | Created user object - -try { - api_instance.createUser(body); -} catch (e) { - print("Exception when calling UserApi->createUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(body) - -Creates list of users with given input array - - - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object - -try { - api_instance.createUsersWithArrayInput(body); -} catch (e) { - print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -> createUsersWithListInput(body) - -Creates list of users with given input array - - - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object - -try { - api_instance.createUsersWithListInput(body); -} catch (e) { - print("Exception when calling UserApi->createUsersWithListInput: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var username = username_example; // String | The name that needs to be deleted - -try { - api_instance.deleteUser(username); -} catch (e) { - print("Exception when calling UserApi->deleteUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - - - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. - -try { - var result = api_instance.getUserByName(username); - print(result); -} catch (e) { - print("Exception when calling UserApi->getUserByName: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - - - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var username = username_example; // String | The user name for login -var password = password_example; // String | The password for login in clear text - -try { - var result = api_instance.loginUser(username, password); - print(result); -} catch (e) { - print("Exception when calling UserApi->loginUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - - - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); - -try { - api_instance.logoutUser(); -} catch (e) { - print("Exception when calling UserApi->logoutUser: $e\n"); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -> updateUser(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:swagger/api.dart'; - -var api_instance = new UserApi(); -var username = username_example; // String | name that need to be deleted -var body = new User(); // User | Updated user object - -try { - api_instance.updateUser(username, body); -} catch (e) { - print("Exception when calling UserApi->updateUser: $e\n"); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/dart-jaguar/swagger/git_push.sh b/samples/client/petstore/dart-jaguar/swagger/git_push.sh deleted file mode 100644 index 83553a63a416..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/api.dart b/samples/client/petstore/dart-jaguar/swagger/lib/api.dart deleted file mode 100644 index 27c7d4164381..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/api.dart +++ /dev/null @@ -1,74 +0,0 @@ -library swagger.api; - -import 'package:jaguar_serializer/jaguar_serializer.dart'; -import 'package:jaguar_retrofit/jaguar_retrofit.dart'; - -import 'package:swagger/api/pet_api.dart'; -import 'package:swagger/api/store_api.dart'; -import 'package:swagger/api/user_api.dart'; - -import 'package:swagger/model/amount.dart'; -import 'package:swagger/model/api_response.dart'; -import 'package:swagger/model/category.dart'; -import 'package:swagger/model/currency.dart'; -import 'package:swagger/model/order.dart'; -import 'package:swagger/model/pet.dart'; -import 'package:swagger/model/tag.dart'; -import 'package:swagger/model/user.dart'; - - -final jsonJaguarRepo = JsonRepo() -..add(AmountSerializer()) -..add(ApiResponseSerializer()) -..add(CategorySerializer()) -..add(CurrencySerializer()) -..add(OrderSerializer()) -..add(PetSerializer()) -..add(TagSerializer()) -..add(UserSerializer()) -; - -final baseSwaggerPath = "http://petstore.swagger.io/v2"; -final _baseRoute = Route(baseSwaggerPath); - -class SwaggerGen { - final List interceptors; - SwaggerGen({this.interceptors = const []}) { - interceptors.forEach((interceptor) { - _baseRoute.before(interceptor.before); - _baseRoute.after(interceptor.after); - }); - } - - PetApi getPetApi({Route base, SerializerRepo serializers}) { - if(base == null) { - base = _baseRoute; - } - if(serializers == null) { - serializers = jsonJaguarRepo; - } - return PetApi(base: base, serializers: serializers); - } - - StoreApi getStoreApi({Route base, SerializerRepo serializers}) { - if(base == null) { - base = _baseRoute; - } - if(serializers == null) { - serializers = jsonJaguarRepo; - } - return StoreApi(base: base, serializers: serializers); - } - - UserApi getUserApi({Route base, SerializerRepo serializers}) { - if(base == null) { - base = _baseRoute; - } - if(serializers == null) { - serializers = jsonJaguarRepo; - } - return UserApi(base: base, serializers: serializers); - } - - -} \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/api/pet_api.dart b/samples/client/petstore/dart-jaguar/swagger/lib/api/pet_api.dart deleted file mode 100644 index 2489ef8b5c32..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/api/pet_api.dart +++ /dev/null @@ -1,99 +0,0 @@ -import 'package:jaguar_retrofit/annotations/annotations.dart'; -import 'package:jaguar_retrofit/jaguar_retrofit.dart'; -import 'package:jaguar_serializer/jaguar_serializer.dart'; -import 'package:jaguar_serializer/src/repo/repo.dart'; -import 'dart:async'; - -import 'package:swagger/model/pet.dart'; -import 'package:swagger/model/api_response.dart'; - - -part 'pet_api.jretro.dart'; - -@GenApiClient() -class PetApi extends _$PetApiClient implements ApiClient { - final Route base; - final SerializerRepo serializers; - - PetApi({this.base, this.serializers}); - - /// Add a new pet to the store - /// - /// - @PostReq(path: '/pet') - Future addPet( - - @AsJson() Pet body - ); - - /// Deletes a pet - /// - /// - @DeleteReq(path: '/pet/:petId') - Future deletePet( - int petId - , - @Header("api_key") String apiKey - ); - - /// Finds Pets by status - /// - /// Multiple status values can be provided with comma separated strings - @GetReq(path: '/pet/findByStatus') - Future> findPetsByStatus( - - @QueryParam("status") List status - ); - - /// Finds Pets by tags - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - @GetReq(path: '/pet/findByTags') - Future> findPetsByTags( - - @QueryParam("tags") List tags - ); - - /// Find pet by ID - /// - /// Returns a single pet - @GetReq(path: '/pet/:petId') - Future getPetById( - int petId - ); - - /// Update an existing pet - /// - /// - @PutReq(path: '/pet') - Future updatePet( - - @AsJson() Pet body - ); - - /// Updates a pet in the store with form data - /// - /// - @PostReq(path: '/pet/:petId') - Future updatePetWithForm( - int petId - , - @AsFormField() String name, - - @AsFormField() String status - ); - - /// uploads an image - /// - /// - @PostReq(path: '/pet/:petId/uploadImage') - Future uploadFile( - int petId - , - @AsMultipartField() String additionalMetadata, - - @AsMultipartField() MultipartFile file - ); - - -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/api/pet_api.jretro.dart b/samples/client/petstore/dart-jaguar/swagger/lib/api/pet_api.jretro.dart deleted file mode 100644 index cfd3ef25d990..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/api/pet_api.jretro.dart +++ /dev/null @@ -1,70 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'pet_api.dart'; - -// ************************************************************************** -// JaguarHttpGenerator -// ************************************************************************** - -abstract class _$PetApiClient implements ApiClient { - final String basePath = ""; - Future addPet(Pet body) async { - var req = base.post.path(basePath).path("/pet").json(serializers.to(body)); - await req.go(); - } - - Future deletePet(int petId, String apiKey) async { - var req = base.delete - .path(basePath) - .path("/pet/:petId") - .pathParams("petId", petId) - .header("api_key", apiKey); - await req.go(); - } - - Future> findPetsByStatus(List status) async { - var req = base.get - .path(basePath) - .path("/pet/findByStatus") - .query("status", status); - return req.list(convert: serializers.oneFrom); - } - - Future> findPetsByTags(List tags) async { - var req = - base.get.path(basePath).path("/pet/findByTags").query("tags", tags); - return req.list(convert: serializers.oneFrom); - } - - Future getPetById(int petId) async { - var req = - base.get.path(basePath).path("/pet/:petId").pathParams("petId", petId); - return req.one(convert: serializers.oneFrom); - } - - Future updatePet(Pet body) async { - var req = base.put.path(basePath).path("/pet").json(serializers.to(body)); - await req.go(); - } - - Future updatePetWithForm(int petId, String name, String status) async { - var req = base.post - .path(basePath) - .path("/pet/:petId") - .pathParams("petId", petId) - .urlEncodedFormField(name, name) - .urlEncodedFormField(status, status); - await req.go(); - } - - Future uploadFile( - int petId, String additionalMetadata, MultipartFile file) async { - var req = base.post - .path(basePath) - .path("/pet/:petId/uploadImage") - .pathParams("petId", petId) - .multipart({"additionalMetadata": additionalMetadata}).multipart( - {"file": file}); - return req.one(convert: serializers.oneFrom); - } -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/api/store_api.dart b/samples/client/petstore/dart-jaguar/swagger/lib/api/store_api.dart deleted file mode 100644 index 1d120cdd6454..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/api/store_api.dart +++ /dev/null @@ -1,52 +0,0 @@ -import 'package:jaguar_retrofit/annotations/annotations.dart'; -import 'package:jaguar_retrofit/jaguar_retrofit.dart'; -import 'package:jaguar_serializer/jaguar_serializer.dart'; -import 'package:jaguar_serializer/src/repo/repo.dart'; -import 'dart:async'; - -import 'package:swagger/model/order.dart'; - - -part 'store_api.jretro.dart'; - -@GenApiClient() -class StoreApi extends _$StoreApiClient implements ApiClient { - final Route base; - final SerializerRepo serializers; - - StoreApi({this.base, this.serializers}); - - /// Delete purchase order by ID - /// - /// 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 - ); - - /// Returns pet inventories by status - /// - /// Returns a map of status codes to quantities - @GetReq(path: '/store/inventory') - Future> getInventory( - ); - - /// Find purchase order by ID - /// - /// 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 - ); - - /// Place an order for a pet - /// - /// - @PostReq(path: '/store/order') - Future placeOrder( - - @AsJson() Order body - ); - - -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/api/store_api.jretro.dart b/samples/client/petstore/dart-jaguar/swagger/lib/api/store_api.jretro.dart deleted file mode 100644 index 50bdba4cef7a..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/api/store_api.jretro.dart +++ /dev/null @@ -1,39 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'store_api.dart'; - -// ************************************************************************** -// JaguarHttpGenerator -// ************************************************************************** - -abstract class _$StoreApiClient implements ApiClient { - final String basePath = ""; - Future deleteOrder(String orderId) async { - var req = base.delete - .path(basePath) - .path("/store/order/:orderId") - .pathParams("orderId", orderId); - await req.go(); - } - - Future> getInventory() async { - var req = base.get.path(basePath).path("/store/inventory"); - return serializers.from(await req.go().body); - } - - Future getOrderById(int orderId) async { - var req = base.get - .path(basePath) - .path("/store/order/:orderId") - .pathParams("orderId", orderId); - return req.one(convert: serializers.oneFrom); - } - - Future placeOrder(Order body) async { - var req = base.post - .path(basePath) - .path("/store/order") - .json(serializers.to(body)); - return req.one(convert: serializers.oneFrom); - } -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/api/user_api.dart b/samples/client/petstore/dart-jaguar/swagger/lib/api/user_api.dart deleted file mode 100644 index 93ef7f77c4d1..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/api/user_api.dart +++ /dev/null @@ -1,91 +0,0 @@ -import 'package:jaguar_retrofit/annotations/annotations.dart'; -import 'package:jaguar_retrofit/jaguar_retrofit.dart'; -import 'package:jaguar_serializer/jaguar_serializer.dart'; -import 'package:jaguar_serializer/src/repo/repo.dart'; -import 'dart:async'; - -import 'package:swagger/model/user.dart'; - - -part 'user_api.jretro.dart'; - -@GenApiClient() -class UserApi extends _$UserApiClient implements ApiClient { - final Route base; - final SerializerRepo serializers; - - UserApi({this.base, this.serializers}); - - /// Create user - /// - /// This can only be done by the logged in user. - @PostReq(path: '/user') - Future createUser( - - @AsJson() User body - ); - - /// Creates list of users with given input array - /// - /// - @PostReq(path: '/user/createWithArray') - Future createUsersWithArrayInput( - - @AsJson() List body - ); - - /// Creates list of users with given input array - /// - /// - @PostReq(path: '/user/createWithList') - Future createUsersWithListInput( - - @AsJson() List body - ); - - /// Delete user - /// - /// This can only be done by the logged in user. - @DeleteReq(path: '/user/:username') - Future deleteUser( - String username - ); - - /// Get user by user name - /// - /// - @GetReq(path: '/user/:username') - Future getUserByName( - String username - ); - - /// Logs user into the system - /// - /// - @GetReq(path: '/user/login') - Future loginUser( - - @QueryParam("username") String username, - - @QueryParam("password") String password - ); - - /// Logs out current logged in user session - /// - /// - @GetReq(path: '/user/logout') - Future logoutUser( - ); - - /// Updated user - /// - /// This can only be done by the logged in user. - @PutReq(path: '/user/:username') - Future updateUser( - String username - , - @AsJson() User body - ); - - -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/api/user_api.jretro.dart b/samples/client/petstore/dart-jaguar/swagger/lib/api/user_api.jretro.dart deleted file mode 100644 index 31f695eb1027..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/api/user_api.jretro.dart +++ /dev/null @@ -1,70 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'user_api.dart'; - -// ************************************************************************** -// JaguarHttpGenerator -// ************************************************************************** - -abstract class _$UserApiClient implements ApiClient { - final String basePath = ""; - Future createUser(User body) async { - var req = base.post.path(basePath).path("/user").json(serializers.to(body)); - await req.go(); - } - - Future createUsersWithArrayInput(List body) async { - var req = base.post - .path(basePath) - .path("/user/createWithArray") - .json(serializers.to(body)); - await req.go(); - } - - Future createUsersWithListInput(List body) async { - var req = base.post - .path(basePath) - .path("/user/createWithList") - .json(serializers.to(body)); - await req.go(); - } - - Future deleteUser(String username) async { - var req = base.delete - .path(basePath) - .path("/user/:username") - .pathParams("username", username); - await req.go(); - } - - Future getUserByName(String username) async { - var req = base.get - .path(basePath) - .path("/user/:username") - .pathParams("username", username); - return req.one(convert: serializers.oneFrom); - } - - Future loginUser(String username, String password) async { - var req = base.get - .path(basePath) - .path("/user/login") - .query("username", username) - .query("password", password); - return req.one(convert: serializers.oneFrom); - } - - Future logoutUser() async { - var req = base.get.path(basePath).path("/user/logout"); - await req.go(); - } - - Future updateUser(String username, User body) async { - var req = base.put - .path(basePath) - .path("/user/:username") - .pathParams("username", username) - .json(serializers.to(body)); - await req.go(); - } -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/amount.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/amount.dart deleted file mode 100644 index e701e966bf0d..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/amount.dart +++ /dev/null @@ -1,32 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -import 'package:swagger/model/currency.dart'; -part 'amount.jser.dart'; - -class Amount { - /* some description */ - final double value; - // range from 0.01 to 1000000000000000// - final Currency currency; - - - Amount( - - -{ - - this.value = null, - this.currency = null - } - ); - - @override - String toString() { - return 'Amount[value=$value, currency=$currency, ]'; - } -} - -@GenSerializer() -class AmountSerializer extends Serializer with _$AmountSerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/amount.jser.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/amount.jser.dart deleted file mode 100644 index 9c03e8a62d49..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/amount.jser.dart +++ /dev/null @@ -1,31 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'amount.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$AmountSerializer implements Serializer { - Serializer __currencySerializer; - Serializer get _currencySerializer => - __currencySerializer ??= new CurrencySerializer(); - @override - Map toMap(Amount model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'value', model.value); - setMapValue(ret, 'currency', _currencySerializer.toMap(model.currency)); - return ret; - } - - @override - Amount fromMap(Map map) { - if (map == null) return null; - final obj = new Amount( - value: map['value'] as double ?? getJserDefault('value'), - currency: _currencySerializer.fromMap(map['currency'] as Map) ?? - getJserDefault('currency')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/api_response.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/api_response.dart deleted file mode 100644 index 2b9fa763b009..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/api_response.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -part 'api_response.jser.dart'; - -class ApiResponse { - - final int code; - - final String type; - - final String message; - - - ApiResponse( - - -{ - this.code = null, - this.type = null, - this.message = null - - } - ); - - @override - String toString() { - return 'ApiResponse[code=$code, type=$type, message=$message, ]'; - } -} - -@GenSerializer() -class ApiResponseSerializer extends Serializer with _$ApiResponseSerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/api_response.jser.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/api_response.jser.dart deleted file mode 100644 index b4b6c090975c..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/api_response.jser.dart +++ /dev/null @@ -1,29 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'api_response.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$ApiResponseSerializer implements Serializer { - @override - Map toMap(ApiResponse model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'code', model.code); - setMapValue(ret, 'type', model.type); - setMapValue(ret, 'message', model.message); - return ret; - } - - @override - ApiResponse fromMap(Map map) { - if (map == null) return null; - final obj = new ApiResponse( - code: map['code'] as int ?? getJserDefault('code'), - type: map['type'] as String ?? getJserDefault('type'), - message: map['message'] as String ?? getJserDefault('message')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/category.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/category.dart deleted file mode 100644 index 2f5e7bd9c50f..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/category.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -part 'category.jser.dart'; - -class Category { - - final int id; - - final String name; - - - Category( - - -{ - this.id = null, - this.name = null - - } - ); - - @override - String toString() { - return 'Category[id=$id, name=$name, ]'; - } -} - -@GenSerializer() -class CategorySerializer extends Serializer with _$CategorySerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/category.jser.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/category.jser.dart deleted file mode 100644 index 763bcd3dd6e2..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/category.jser.dart +++ /dev/null @@ -1,27 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'category.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$CategorySerializer implements Serializer { - @override - Map toMap(Category model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'id', model.id); - setMapValue(ret, 'name', model.name); - return ret; - } - - @override - Category fromMap(Map map) { - if (map == null) return null; - final obj = new Category( - id: map['id'] as int ?? getJserDefault('id'), - name: map['name'] as String ?? getJserDefault('name')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/currency.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/currency.dart deleted file mode 100644 index 9a5825e52d55..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/currency.dart +++ /dev/null @@ -1,23 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -part 'currency.jser.dart'; - -class Currency { - - - Currency( - - - - ); - - @override - String toString() { - return 'Currency[]'; - } -} - -@GenSerializer() -class CurrencySerializer extends Serializer with _$CurrencySerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/currency.jser.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/currency.jser.dart deleted file mode 100644 index 6bc06bc69bc0..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/currency.jser.dart +++ /dev/null @@ -1,23 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'currency.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$CurrencySerializer implements Serializer { - @override - Map toMap(Currency model) { - if (model == null) return null; - Map ret = {}; - return ret; - } - - @override - Currency fromMap(Map map) { - if (map == null) return null; - final obj = new Currency(); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/order.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/order.dart deleted file mode 100644 index 46a7a839b3b0..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/order.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -part 'order.jser.dart'; - -class Order { - - final int id; - - final int petId; - - final int quantity; - - final DateTime shipDate; - /* Order Status */ - final String status; - //enum statusEnum { placed, approved, delivered, }; - final bool complete; - - - Order( - - -{ - this.id = null, - this.petId = null, - this.quantity = null, - this.shipDate = null, - this.status = null, - this.complete = null - - } - ); - - @override - String toString() { - return 'Order[id=$id, petId=$petId, quantity=$quantity, shipDate=$shipDate, status=$status, complete=$complete, ]'; - } -} - -@GenSerializer() -class OrderSerializer extends Serializer with _$OrderSerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/order.jser.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/order.jser.dart deleted file mode 100644 index 52e5d7a01bad..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/order.jser.dart +++ /dev/null @@ -1,37 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'order.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$OrderSerializer implements Serializer { - @override - Map toMap(Order model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'id', model.id); - setMapValue(ret, 'petId', model.petId); - setMapValue(ret, 'quantity', model.quantity); - setMapValue( - ret, 'shipDate', dateTimeUtcProcessor.serialize(model.shipDate)); - setMapValue(ret, 'status', model.status); - setMapValue(ret, 'complete', model.complete); - return ret; - } - - @override - Order fromMap(Map map) { - if (map == null) return null; - final obj = new Order( - id: map['id'] as int ?? getJserDefault('id'), - petId: map['petId'] as int ?? getJserDefault('petId'), - quantity: map['quantity'] as int ?? getJserDefault('quantity'), - shipDate: dateTimeUtcProcessor.deserialize(map['shipDate'] as String) ?? - getJserDefault('shipDate'), - status: map['status'] as String ?? getJserDefault('status'), - complete: map['complete'] as bool ?? getJserDefault('complete')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/pet.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/pet.dart deleted file mode 100644 index 0c1d274b8b4a..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/pet.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -import 'package:swagger/model/tag.dart'; -import 'package:swagger/model/category.dart'; -part 'pet.jser.dart'; - -class Pet { - - final int id; - - final Category category; - - final String name; - - final List photoUrls; - - final List tags; - /* pet status in the store */ - final String status; - //enum statusEnum { available, pending, sold, }; - - Pet( - - -{ - this.id = null, - this.category = null, - - this.name = null, - this.photoUrls = const [], this.tags = const [], - this.status = null - - } - ); - - @override - String toString() { - return 'Pet[id=$id, category=$category, name=$name, photoUrls=$photoUrls, tags=$tags, status=$status, ]'; - } -} - -@GenSerializer() -class PetSerializer extends Serializer with _$PetSerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/pet.jser.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/pet.jser.dart deleted file mode 100644 index ce4f22f96865..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/pet.jser.dart +++ /dev/null @@ -1,47 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'pet.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$PetSerializer implements Serializer { - Serializer __categorySerializer; - Serializer get _categorySerializer => - __categorySerializer ??= new CategorySerializer(); - Serializer __tagSerializer; - Serializer get _tagSerializer => __tagSerializer ??= new TagSerializer(); - @override - Map toMap(Pet model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'id', model.id); - setMapValue(ret, 'category', _categorySerializer.toMap(model.category)); - setMapValue(ret, 'name', model.name); - setMapValue(ret, 'photoUrls', - codeIterable(model.photoUrls, (val) => val as String)); - setMapValue(ret, 'tags', - codeIterable(model.tags, (val) => _tagSerializer.toMap(val as Tag))); - setMapValue(ret, 'status', model.status); - return ret; - } - - @override - Pet fromMap(Map map) { - if (map == null) return null; - final obj = new Pet( - id: map['id'] as int ?? getJserDefault('id'), - category: _categorySerializer.fromMap(map['category'] as Map) ?? - getJserDefault('category'), - name: map['name'] as String ?? getJserDefault('name'), - photoUrls: codeIterable( - map['photoUrls'] as Iterable, (val) => val as String) ?? - getJserDefault('photoUrls'), - tags: codeIterable(map['tags'] as Iterable, - (val) => _tagSerializer.fromMap(val as Map)) ?? - getJserDefault('tags'), - status: map['status'] as String ?? getJserDefault('status')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/tag.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/tag.dart deleted file mode 100644 index 7b294b3008b5..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/tag.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -part 'tag.jser.dart'; - -class Tag { - - final int id; - - final String name; - - - Tag( - - -{ - this.id = null, - this.name = null - - } - ); - - @override - String toString() { - return 'Tag[id=$id, name=$name, ]'; - } -} - -@GenSerializer() -class TagSerializer extends Serializer with _$TagSerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/tag.jser.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/tag.jser.dart deleted file mode 100644 index cdb14e1783ee..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/tag.jser.dart +++ /dev/null @@ -1,27 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'tag.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$TagSerializer implements Serializer { - @override - Map toMap(Tag model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'id', model.id); - setMapValue(ret, 'name', model.name); - return ret; - } - - @override - Tag fromMap(Map map) { - if (map == null) return null; - final obj = new Tag( - id: map['id'] as int ?? getJserDefault('id'), - name: map['name'] as String ?? getJserDefault('name')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/user.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/user.dart deleted file mode 100644 index fddc756616a1..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/user.dart +++ /dev/null @@ -1,49 +0,0 @@ -import 'package:jaguar_serializer/jaguar_serializer.dart'; - -part 'user.jser.dart'; - -class User { - - final int id; - - final String username; - - final String firstName; - - final String lastName; - - final String email; - - final String password; - - final String phone; - /* User Status */ - final int userStatus; - - - User( - - -{ - this.id = null, - this.username = null, - this.firstName = null, - this.lastName = null, - this.email = null, - this.password = null, - this.phone = null, - this.userStatus = null - - } - ); - - @override - String toString() { - return 'User[id=$id, username=$username, firstName=$firstName, lastName=$lastName, email=$email, password=$password, phone=$phone, userStatus=$userStatus, ]'; - } -} - -@GenSerializer() -class UserSerializer extends Serializer with _$UserSerializer { - -} diff --git a/samples/client/petstore/dart-jaguar/swagger/lib/model/user.jser.dart b/samples/client/petstore/dart-jaguar/swagger/lib/model/user.jser.dart deleted file mode 100644 index 0eced9472d04..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/lib/model/user.jser.dart +++ /dev/null @@ -1,39 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'user.dart'; - -// ************************************************************************** -// JaguarSerializerGenerator -// ************************************************************************** - -abstract class _$UserSerializer implements Serializer { - @override - Map toMap(User model) { - if (model == null) return null; - Map ret = {}; - setMapValue(ret, 'id', model.id); - setMapValue(ret, 'username', model.username); - setMapValue(ret, 'firstName', model.firstName); - setMapValue(ret, 'lastName', model.lastName); - setMapValue(ret, 'email', model.email); - setMapValue(ret, 'password', model.password); - setMapValue(ret, 'phone', model.phone); - setMapValue(ret, 'userStatus', model.userStatus); - return ret; - } - - @override - User fromMap(Map map) { - if (map == null) return null; - final obj = new User( - id: map['id'] as int ?? getJserDefault('id'), - username: map['username'] as String ?? getJserDefault('username'), - firstName: map['firstName'] as String ?? getJserDefault('firstName'), - lastName: map['lastName'] as String ?? getJserDefault('lastName'), - email: map['email'] as String ?? getJserDefault('email'), - password: map['password'] as String ?? getJserDefault('password'), - phone: map['phone'] as String ?? getJserDefault('phone'), - userStatus: map['userStatus'] as int ?? getJserDefault('userStatus')); - return obj; - } -} diff --git a/samples/client/petstore/dart-jaguar/swagger/pubspec.yaml b/samples/client/petstore/dart-jaguar/swagger/pubspec.yaml deleted file mode 100644 index 697b383f0f17..000000000000 --- a/samples/client/petstore/dart-jaguar/swagger/pubspec.yaml +++ /dev/null @@ -1,12 +0,0 @@ -name: swagger -version: 1.0.0 -description: Swagger API client -environment: - sdk: ">=2.0.0 <3.0.0" -dependencies: - jaguar_retrofit: '^2.4.1' - jaguar_serializer: '^2.2.0' -dev_dependencies: - jaguar_retrofit_gen: '^2.4.2' - jaguar_serializer_cli: '^2.2.1' - build_runner: '^0.10.0' \ No newline at end of file