diff --git a/.gitignore b/.gitignore index 201207ddb6c..3eb73dfcfaa 100644 --- a/.gitignore +++ b/.gitignore @@ -197,3 +197,8 @@ samples/client/petstore/erlang-client/_build/ samples/client/petstore/erlang-client/rebar.lock samples/server/petstore/erlang-server/_build/ samples/server/petstore/erlang-server/rebar.lock + +# dart +samples/client/petstore/dart/petstore/packages +samples/client/petstore/dart/flutter_petstore/test/packages +samples/client/petstore/dart/petstore/test/packages diff --git a/bin/dart-petstore.sh b/bin/dart-petstore.sh index 4875c422902..a25c7804bd0 100755 --- a/bin/dart-petstore.sh +++ b/bin/dart-petstore.sh @@ -29,18 +29,18 @@ fi export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" # Generate non-browserClient -ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger -DhideGenerationTimestamp=true -DbrowserClient=false" +ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/openapi -DhideGenerationTimestamp=true -DbrowserClient=false" # then options to generate the library for vm would be: -#ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger_vm -DbrowserClient=false -DpubName=swagger_vm" +#ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/openapi_vm -DbrowserClient=false -DpubName=openapi_vm" java $JAVA_OPTS -jar $executable $ags # Generate browserClient -ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger-browser-client -DhideGenerationTimestamp=true -DbrowserClient=true" +ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/openapi-browser-client -DhideGenerationTimestamp=true -DbrowserClient=true" java $JAVA_OPTS -jar $executable $ags # Generate non-browserClient and put it to the flutter sample app -ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/flutter_petstore/swagger -DhideGenerationTimestamp=true -DbrowserClient=false" +ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l dart -o samples/client/petstore/dart/flutter_petstore/openapi -DhideGenerationTimestamp=true -DbrowserClient=false" java $JAVA_OPTS -jar $executable $ags # There is a proposal to allow importing different libraries depending on the environment: @@ -48,4 +48,3 @@ java $JAVA_OPTS -jar $executable $ags # When this is implemented there will only be one library. # The current petstore test will then work for both: the browser library and the vm library. - diff --git a/bin/openapi3/dart-petstore.sh b/bin/openapi3/dart-petstore.sh index c7d7fce7692..56da6ccd63f 100755 --- a/bin/openapi3/dart-petstore.sh +++ b/bin/openapi3/dart-petstore.sh @@ -29,18 +29,18 @@ fi export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" # Generate non-browserClient -ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger -DhideGenerationTimestamp=true -DbrowserClient=false" +ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/openapi -DhideGenerationTimestamp=true -DbrowserClient=false" # then options to generate the library for vm would be: -#ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger_vm -DbrowserClient=false -DpubName=swagger_vm" +#ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/openapi_vm -DbrowserClient=false -DpubName=openapi_vm" #java $JAVA_OPTS -jar $executable $ags # Generate browserClient -ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/swagger-browser-client -DhideGenerationTimestamp=true -DbrowserClient=true" +ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/openapi-browser-client -DhideGenerationTimestamp=true -DbrowserClient=true" #java $JAVA_OPTS -jar $executable $ags # Generate non-browserClient and put it to the flutter sample app -ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/flutter_petstore/swagger -DhideGenerationTimestamp=true -DbrowserClient=false" +ags="$@ generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -l dart -o samples/client/petstore/dart/flutter_petstore/openapi -DhideGenerationTimestamp=true -DbrowserClient=false" java $JAVA_OPTS -jar $executable $ags # There is a proposal to allow importing different libraries depending on the environment: diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java index cc64a74e212..3c7c2b7eea0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartClientCodegen.java @@ -44,13 +44,13 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { public static final String PUB_DESCRIPTION = "pubDescription"; public static final String USE_ENUM_EXTENSION = "useEnumExtension"; protected boolean browserClient = true; - protected String pubName = "swagger"; + protected String pubName = "openapi"; protected String pubVersion = "1.0.0"; - protected String pubDescription = "Swagger API client"; + protected String pubDescription = "OpenAPI API client"; protected boolean useEnumExtension = false; protected String sourceFolder = ""; - protected String apiDocPath = "docs/"; - protected String modelDocPath = "docs/"; + protected String apiDocPath = "docs" + File.separator; + protected String modelDocPath = "docs" + File.separator; public DartClientCodegen() { super(); @@ -110,10 +110,9 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { typeMapping.put("Date", "DateTime"); typeMapping.put("date", "DateTime"); typeMapping.put("File", "MultipartFile"); + typeMapping.put("binary", "MultipartFile"); typeMapping.put("UUID", "String"); - //TODO binary should be mapped to byte array - // mapped to String as a workaround - typeMapping.put("binary", "String"); + typeMapping.put("ByteArray", "String"); cliOptions.add(new CliOption(BROWSER_CLIENT, "Is the client browser based")); cliOptions.add(new CliOption(PUB_NAME, "Name in generated pubspec")); @@ -210,12 +209,12 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { @Override public String apiFileFolder() { - return outputFolder + "/" + sourceFolder + "/" + apiPackage().replace('.', File.separatorChar); + return outputFolder + File.separator + sourceFolder + File.separator + apiPackage().replace('.', File.separatorChar); } @Override public String modelFileFolder() { - return outputFolder + "/" + sourceFolder + "/" + modelPackage().replace('.', File.separatorChar); + return outputFolder + File.separator + sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar); } @Override @@ -231,7 +230,7 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { @Override public String toVarName(String name) { // replace - with _ e.g. created-at => created_at - name = name.replaceAll("-", "_"); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + name = name.replaceAll("-", "_"); // if it's all uppper case, do nothing if (name.matches("^[A-Z_]*$")) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java index c7865f2de3e..059fa5d8362 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java @@ -42,10 +42,8 @@ public class ElixirClientOptionsTest extends AbstractOptionsTest { @Override protected void setExpectations() { new Expectations(clientCodegen) {{ - // TODO clientCodegen.setModuleName(ElixirClientOptionsProvider.INVOKER_PACKAGE_VALUE); times = 1; - }}; } -} +} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/objc/ObjcModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/objc/ObjcModelTest.java index ecb25049623..a06d1f00182 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/objc/ObjcModelTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/objc/ObjcModelTest.java @@ -275,7 +275,7 @@ public class ObjcModelTest { Assert.assertEquals(Sets.intersection(cm.imports, Sets.newHashSet("SWGChildren")).size(), 1); } - @Test(description = "convert an map model", enabled = false) + @Test(description = "convert an map model") public void mapModelTest() { final Schema model = new Schema() .description("a map model for testing ObjC generator") @@ -329,7 +329,7 @@ public class ObjcModelTest { } - @Test(description = "test binary data", enabled = false) + @Test(description = "test binary data") public void binaryDataModelTest() { final OpenAPI model = new OpenAPIParser().readLocation("src/test/resources/2_0/binaryDataTest.json", null, new ParseOptions()).getOpenAPI(); final DefaultCodegen codegen = new ObjcClientCodegen(); @@ -339,8 +339,8 @@ public class ObjcModelTest { Assert.assertTrue(op.bodyParam.isBinary); Assert.assertTrue(op.responses.get(0).isBinary); - Assert.assertEquals(op.returnType, "NSData*"); - Assert.assertEquals(op.bodyParam.dataType, "NSData*"); + Assert.assertEquals(op.returnType, "NSURL*"); + Assert.assertEquals(op.bodyParam.dataType, "NSURL*"); } @Test(description = "create proper imports per #316") diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.analysis_options b/samples/client/petstore/dart/flutter_petstore/.analysis_options similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/.analysis_options rename to samples/client/petstore/dart/flutter_petstore/.analysis_options diff --git a/samples/client/petstore/dart/flutter_petstore/.gitignore b/samples/client/petstore/dart/flutter_petstore/.gitignore index eb15c3d27ca..7c280441649 100644 --- a/samples/client/petstore/dart/flutter_petstore/.gitignore +++ b/samples/client/petstore/dart/flutter_petstore/.gitignore @@ -1,10 +1,27 @@ -.DS_Store -.atom/ -.idea +# See https://www.dartlang.org/tools/private-files.html + +# Files and directories created by pub +.buildlog .packages +.project .pub/ build/ -ios/.generated/ -packages +**/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 -.flutter-plugins diff --git a/samples/client/petstore/dart/swagger-browser-client/.openapi-generator-ignore b/samples/client/petstore/dart/flutter_petstore/.openapi-generator-ignore similarity index 78% rename from samples/client/petstore/dart/swagger-browser-client/.openapi-generator-ignore rename to samples/client/petstore/dart/flutter_petstore/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/dart/swagger-browser-client/.openapi-generator-ignore +++ b/samples/client/petstore/dart/flutter_petstore/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # 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: +# You can make changes and tell OpenAPI Generator 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 (*): diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION b/samples/client/petstore/dart/flutter_petstore/.openapi-generator/VERSION similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION rename to samples/client/petstore/dart/flutter_petstore/.openapi-generator/VERSION diff --git a/samples/client/petstore/dart/swagger-browser-client/.analysis_options b/samples/client/petstore/dart/flutter_petstore/openapi/.analysis_options similarity index 100% rename from samples/client/petstore/dart/swagger-browser-client/.analysis_options rename to samples/client/petstore/dart/flutter_petstore/openapi/.analysis_options diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.gitignore b/samples/client/petstore/dart/flutter_petstore/openapi/.gitignore similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/.gitignore rename to samples/client/petstore/dart/flutter_petstore/openapi/.gitignore diff --git a/samples/client/petstore/dart/swagger/.openapi-generator-ignore b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator-ignore similarity index 78% rename from samples/client/petstore/dart/swagger/.openapi-generator-ignore rename to samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator-ignore index c5fa491b4c5..7484ee590a3 100644 --- a/samples/client/petstore/dart/swagger/.openapi-generator-ignore +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator # 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: +# You can make changes and tell OpenAPI Generator 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 (*): diff --git a/samples/client/petstore/dart/swagger-browser-client/.openapi-generator/VERSION b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION similarity index 100% rename from samples/client/petstore/dart/swagger-browser-client/.openapi-generator/VERSION rename to samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/README.md b/samples/client/petstore/dart/flutter_petstore/openapi/README.md similarity index 95% rename from samples/client/petstore/dart/flutter_petstore/swagger/README.md rename to samples/client/petstore/dart/flutter_petstore/openapi/README.md index 9ec33fa98a8..290d1cc7a4b 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/README.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/README.md @@ -1,4 +1,4 @@ -# swagger +# openapi 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 [OpenAPI Generator](https://openapi-generator.tech) project: @@ -15,11 +15,11 @@ Dart 1.20.0 or later OR Flutter 0.0.20 or later ### Github If this Dart package is published to Github, please include the following in pubspec.yaml ``` -name: swagger +name: openapi version: 1.0.0 -description: Swagger API client +description: OpenAPI API client dependencies: - swagger: + openapi: git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git version: 'any' ``` @@ -28,8 +28,8 @@ dependencies: To use the package in your local drive, please include the following in pubspec.yaml ``` dependencies: - swagger: - path: /path/to/swagger + openapi: + path: /path/to/openapi ``` ## Tests @@ -41,10 +41,10 @@ TODO Please follow the [installation procedure](#installation--usage) and then run the following: ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var pet = new Pet(); // Pet | Pet object that needs to be added to the store diff --git a/samples/client/petstore/dart/swagger/docs/ApiResponse.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/ApiResponse.md similarity index 88% rename from samples/client/petstore/dart/swagger/docs/ApiResponse.md rename to samples/client/petstore/dart/flutter_petstore/openapi/docs/ApiResponse.md index 7bc0c834d78..92422f0f446 100644 --- a/samples/client/petstore/dart/swagger/docs/ApiResponse.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/ApiResponse.md @@ -1,8 +1,8 @@ -# swagger.model.ApiResponse +# openapi.model.ApiResponse ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/swagger/docs/Category.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/Category.md similarity index 87% rename from samples/client/petstore/dart/swagger/docs/Category.md rename to samples/client/petstore/dart/flutter_petstore/openapi/docs/Category.md index 3f5d01c5e1c..cc0d1633b59 100644 --- a/samples/client/petstore/dart/swagger/docs/Category.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/Category.md @@ -1,8 +1,8 @@ -# swagger.model.Category +# openapi.model.Category ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/Order.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/Order.md similarity index 92% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/Order.md rename to samples/client/petstore/dart/flutter_petstore/openapi/docs/Order.md index c2ace4ef798..310ce6c65be 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/Order.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/Order.md @@ -1,8 +1,8 @@ -# swagger.model.Order +# openapi.model.Order ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/Pet.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/Pet.md similarity index 92% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/Pet.md rename to samples/client/petstore/dart/flutter_petstore/openapi/docs/Pet.md index 3f8629fbd43..191e1fc66a9 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/Pet.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/Pet.md @@ -1,8 +1,8 @@ -# swagger.model.Pet +# openapi.model.Pet ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md similarity index 91% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md rename to samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md index cc7825223f4..6fa9abf67ae 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md @@ -1,8 +1,8 @@ -# swagger.api.PetApi +# openapi.api.PetApi ## Load the API package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` All URIs are relative to *http://petstore.swagger.io/v2* @@ -26,9 +26,9 @@ Add a new pet to the store ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var pet = new Pet(); // Pet | Pet object that needs to be added to the store @@ -68,9 +68,9 @@ Deletes a pet ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var petId = 789; // int | Pet id to delete @@ -114,9 +114,9 @@ Multiple status values can be provided with comma separated strings ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var status = []; // List | Status values that need to be considered for filter @@ -159,9 +159,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var tags = []; // List | Tags to filter by @@ -204,11 +204,11 @@ Returns a single pet ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +//openapi.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"; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new PetApi(); var petId = 789; // int | ID of pet to return @@ -249,9 +249,9 @@ Update an existing pet ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var pet = new Pet(); // Pet | Pet object that needs to be added to the store @@ -291,9 +291,9 @@ Updates a pet in the store with form data ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var petId = 789; // int | ID of pet that needs to be updated @@ -337,9 +337,9 @@ uploads an image ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var petId = 789; // int | ID of pet to update diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md similarity index 92% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md rename to samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md index 2810cdd910c..cc0c2ac2d35 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md @@ -1,8 +1,8 @@ -# swagger.api.StoreApi +# openapi.api.StoreApi ## Load the API package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` All URIs are relative to *http://petstore.swagger.io/v2* @@ -24,7 +24,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new StoreApi(); var orderId = orderId_example; // String | ID of the order that needs to be deleted @@ -66,11 +66,11 @@ Returns a map of status codes to quantities ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +//openapi.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"; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new StoreApi(); @@ -109,7 +109,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new StoreApi(); var orderId = 789; // int | ID of pet that needs to be fetched @@ -150,7 +150,7 @@ Place an order for a pet ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new StoreApi(); var order = new Order(); // Order | order placed for purchasing the pet @@ -179,7 +179,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **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/flutter_petstore/swagger/docs/Tag.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/Tag.md similarity index 88% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/Tag.md rename to samples/client/petstore/dart/flutter_petstore/openapi/docs/Tag.md index c644f1e826a..ded7b32ac3d 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/Tag.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/Tag.md @@ -1,8 +1,8 @@ -# swagger.model.Tag +# openapi.model.Tag ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/User.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/User.md similarity index 93% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/User.md rename to samples/client/petstore/dart/flutter_petstore/openapi/docs/User.md index d49bb37d96c..3761b70cf0b 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/User.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/User.md @@ -1,8 +1,8 @@ -# swagger.model.User +# openapi.model.User ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md similarity index 94% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md rename to samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md index c3012ea508c..0dec271be5c 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md @@ -1,8 +1,8 @@ -# swagger.api.UserApi +# openapi.api.UserApi ## Load the API package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` All URIs are relative to *http://petstore.swagger.io/v2* @@ -28,7 +28,7 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); var user = new User(); // User | Created user object @@ -56,7 +56,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: Not defined [[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) @@ -68,7 +68,7 @@ Creates list of users with given input array ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); var user = [new List<User>()]; // List | List of user object @@ -96,7 +96,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: Not defined [[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) @@ -108,7 +108,7 @@ Creates list of users with given input array ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); var user = [new List<User>()]; // List | List of user object @@ -136,7 +136,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: Not defined [[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) @@ -150,7 +150,7 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); var username = username_example; // String | The name that needs to be deleted @@ -190,7 +190,7 @@ Get user by user name ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. @@ -231,7 +231,7 @@ Logs user into the system ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); var username = username_example; // String | The user name for login @@ -274,7 +274,7 @@ Logs out current logged in user session ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); @@ -312,7 +312,7 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); var username = username_example; // String | name that need to be deleted @@ -342,7 +342,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: Not defined [[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/flutter_petstore/swagger/git_push.sh b/samples/client/petstore/dart/flutter_petstore/openapi/git_push.sh similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/git_push.sh rename to samples/client/petstore/dart/flutter_petstore/openapi/git_push.sh diff --git a/samples/client/petstore/dart/swagger/lib/api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart similarity index 96% rename from samples/client/petstore/dart/swagger/lib/api.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart index 6853e7c628f..9a64a5342b4 100644 --- a/samples/client/petstore/dart/swagger/lib/api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart @@ -1,4 +1,4 @@ -library swagger.api; +library openapi.api; import 'dart:async'; import 'dart:convert'; diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart similarity index 99% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart index 288836e86a0..4134e018386 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart similarity index 98% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart index 39026fc9898..f2a48f2d4da 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; @@ -173,7 +173,7 @@ class StoreApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart similarity index 98% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart index 76798563a95..cf8ef6bf800 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; @@ -26,7 +26,7 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; @@ -75,7 +75,7 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; @@ -124,7 +124,7 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; @@ -376,7 +376,7 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart similarity index 99% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart index 5ba2bb32f51..db4116dd96d 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class QueryParam { String name; diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_exception.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart similarity index 96% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api_exception.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart index b861591bec0..f188fd125a4 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_exception.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class ApiException implements Exception { int code = 0; diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/api_helper.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart similarity index 98% rename from samples/client/petstore/dart/swagger-browser-client/lib/api_helper.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart index 82eb1f3fb36..79af4521d5b 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/api_helper.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart similarity index 96% rename from samples/client/petstore/dart/swagger-browser-client/lib/auth/api_key_auth.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart index aacfa9b2d94..f9617f7ae4d 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class ApiKeyAuth implements Authentication { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/authentication.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/authentication.dart similarity index 89% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/authentication.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/authentication.dart index b1a7c574cf9..abd5e2fe68a 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/authentication.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/authentication.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; abstract class Authentication { diff --git a/samples/client/petstore/dart/swagger/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart similarity index 94% rename from samples/client/petstore/dart/swagger/lib/auth/http_basic_auth.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart index 7a118d6cdad..4e77ddcf6e6 100644 --- a/samples/client/petstore/dart/swagger/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class HttpBasicAuth implements Authentication { diff --git a/samples/client/petstore/dart/swagger/lib/auth/oauth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart similarity index 94% rename from samples/client/petstore/dart/swagger/lib/auth/oauth.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart index 10726213b45..13bfd799743 100644 --- a/samples/client/petstore/dart/swagger/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class OAuth implements Authentication { String accessToken; diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart similarity index 97% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart index be00a0b15df..a39d9500b29 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class ApiResponse { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart similarity index 97% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart index 7975849f91d..b9b2481dd29 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class Category { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart similarity index 98% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart index 2084e2abb4b..4e264a183ef 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class Order { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart similarity index 98% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart index 6bd04ecbf1a..4d2f77a1a5a 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class Pet { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart similarity index 97% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart index 06a042eec01..315a326adb7 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class Tag { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart similarity index 98% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart rename to samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart index 47c7453f698..0e4cc2104c7 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class User { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml similarity index 54% rename from samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml rename to samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml index 1f94390bbb7..d54efb46a2e 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml @@ -1,5 +1,5 @@ -name: swagger +name: openapi version: 1.0.0 -description: Swagger API client +description: OpenAPI API client dependencies: http: '>=0.11.1 <0.12.0' diff --git a/samples/client/petstore/dart/flutter_petstore/pubspec.yaml b/samples/client/petstore/dart/flutter_petstore/pubspec.yaml index b5ff79c337a..b8b388256f2 100644 --- a/samples/client/petstore/dart/flutter_petstore/pubspec.yaml +++ b/samples/client/petstore/dart/flutter_petstore/pubspec.yaml @@ -1,11 +1,11 @@ name: flutter_petstore -description: Swagger petstore sample flutter +description: OpenAPI petstore sample flutter dependencies: flutter: sdk: flutter - swagger: - path: ./swagger + openapi: + path: ./openapi # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. diff --git a/samples/client/petstore/dart/swagger/.analysis_options b/samples/client/petstore/dart/openapi-browser-client/.analysis_options similarity index 100% rename from samples/client/petstore/dart/swagger/.analysis_options rename to samples/client/petstore/dart/openapi-browser-client/.analysis_options diff --git a/samples/client/petstore/dart/swagger-browser-client/.gitignore b/samples/client/petstore/dart/openapi-browser-client/.gitignore similarity index 100% rename from samples/client/petstore/dart/swagger-browser-client/.gitignore rename to samples/client/petstore/dart/openapi-browser-client/.gitignore diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator-ignore b/samples/client/petstore/dart/openapi-browser-client/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator-ignore rename to samples/client/petstore/dart/openapi-browser-client/.openapi-generator-ignore diff --git a/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION b/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION new file mode 100644 index 00000000000..096bf47efe3 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION @@ -0,0 +1 @@ +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/swagger/README.md b/samples/client/petstore/dart/openapi-browser-client/README.md similarity index 88% rename from samples/client/petstore/dart/swagger/README.md rename to samples/client/petstore/dart/openapi-browser-client/README.md index 2136cafdd5d..290d1cc7a4b 100644 --- a/samples/client/petstore/dart/swagger/README.md +++ b/samples/client/petstore/dart/openapi-browser-client/README.md @@ -1,10 +1,10 @@ -# swagger +# openapi 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: +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- Build package: io.swagger.codegen.languages.DartClientCodegen +- Build package: org.openapitools.codegen.languages.DartClientCodegen ## Requirements @@ -15,11 +15,11 @@ Dart 1.20.0 or later OR Flutter 0.0.20 or later ### Github If this Dart package is published to Github, please include the following in pubspec.yaml ``` -name: swagger +name: openapi version: 1.0.0 -description: Swagger API client +description: OpenAPI API client dependencies: - swagger: + openapi: git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git version: 'any' ``` @@ -28,8 +28,8 @@ dependencies: To use the package in your local drive, please include the following in pubspec.yaml ``` dependencies: - swagger: - path: /path/to/swagger + openapi: + path: /path/to/openapi ``` ## Tests @@ -41,16 +41,16 @@ TODO Please follow the [installation procedure](#installation--usage) and then run the following: ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.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 +var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(body); + api_instance.addPet(pet); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -59,7 +59,7 @@ try { ## Documentation for API Endpoints -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/ApiResponse.md b/samples/client/petstore/dart/openapi-browser-client/docs/ApiResponse.md similarity index 88% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/ApiResponse.md rename to samples/client/petstore/dart/openapi-browser-client/docs/ApiResponse.md index 7bc0c834d78..92422f0f446 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/ApiResponse.md +++ b/samples/client/petstore/dart/openapi-browser-client/docs/ApiResponse.md @@ -1,8 +1,8 @@ -# swagger.model.ApiResponse +# openapi.model.ApiResponse ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/swagger-browser-client/docs/Category.md b/samples/client/petstore/dart/openapi-browser-client/docs/Category.md similarity index 87% rename from samples/client/petstore/dart/swagger-browser-client/docs/Category.md rename to samples/client/petstore/dart/openapi-browser-client/docs/Category.md index 3f5d01c5e1c..cc0d1633b59 100644 --- a/samples/client/petstore/dart/swagger-browser-client/docs/Category.md +++ b/samples/client/petstore/dart/openapi-browser-client/docs/Category.md @@ -1,8 +1,8 @@ -# swagger.model.Category +# openapi.model.Category ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/swagger/docs/Order.md b/samples/client/petstore/dart/openapi-browser-client/docs/Order.md similarity index 84% rename from samples/client/petstore/dart/swagger/docs/Order.md rename to samples/client/petstore/dart/openapi-browser-client/docs/Order.md index c076322a76e..310ce6c65be 100644 --- a/samples/client/petstore/dart/swagger/docs/Order.md +++ b/samples/client/petstore/dart/openapi-browser-client/docs/Order.md @@ -1,8 +1,8 @@ -# swagger.model.Order +# openapi.model.Order ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties @@ -13,7 +13,7 @@ Name | Type | Description | Notes **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] +**complete** | **bool** | | [optional] [default to false] [[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/swagger/docs/Pet.md b/samples/client/petstore/dart/openapi-browser-client/docs/Pet.md similarity index 92% rename from samples/client/petstore/dart/swagger/docs/Pet.md rename to samples/client/petstore/dart/openapi-browser-client/docs/Pet.md index 3f8629fbd43..191e1fc66a9 100644 --- a/samples/client/petstore/dart/swagger/docs/Pet.md +++ b/samples/client/petstore/dart/openapi-browser-client/docs/Pet.md @@ -1,8 +1,8 @@ -# swagger.model.Pet +# openapi.model.Pet ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/swagger/docs/PetApi.md b/samples/client/petstore/dart/openapi-browser-client/docs/PetApi.md similarity index 83% rename from samples/client/petstore/dart/swagger/docs/PetApi.md rename to samples/client/petstore/dart/openapi-browser-client/docs/PetApi.md index 6f353923e87..6fa9abf67ae 100644 --- a/samples/client/petstore/dart/swagger/docs/PetApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/docs/PetApi.md @@ -1,11 +1,11 @@ -# swagger.api.PetApi +# openapi.api.PetApi ## Load the API package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -20,23 +20,21 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.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 +var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(body); + api_instance.addPet(pet); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -46,7 +44,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -59,7 +57,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -68,13 +66,11 @@ void (empty response body) Deletes a pet - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var petId = 789; // int | Pet id to delete @@ -105,7 +101,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -118,9 +114,9 @@ Multiple status values can be provided with comma separated strings ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var status = []; // List | Status values that need to be considered for filter @@ -163,9 +159,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var tags = []; // List | Tags to filter by @@ -208,11 +204,11 @@ Returns a single pet ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +//openapi.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"; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new PetApi(); var petId = 789; // int | ID of pet to return @@ -247,23 +243,21 @@ Name | Type | Description | Notes [[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) +> updatePet(pet) Update an existing pet - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.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 +var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.updatePet(body); + api_instance.updatePet(pet); } catch (e) { print("Exception when calling PetApi->updatePet: $e\n"); } @@ -273,7 +267,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -286,7 +280,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -295,13 +289,11 @@ void (empty response body) Updates a pet in the store with form data - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var petId = 789; // int | ID of pet that needs to be updated @@ -320,8 +312,8 @@ try { 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] + **name** | **String**| Updated name of the pet | [optional] [default to null] + **status** | **String**| Updated status of the pet | [optional] [default to null] ### Return type @@ -334,7 +326,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -343,18 +335,16 @@ void (empty response body) uploads an image - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.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 +var file = BINARY_DATA_HERE; // MultipartFile | file to upload try { var result = api_instance.uploadFile(petId, additionalMetadata, file); @@ -369,8 +359,8 @@ try { 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] + **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] + **file** | **MultipartFile**| file to upload | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/dart/swagger/docs/StoreApi.md b/samples/client/petstore/dart/openapi-browser-client/docs/StoreApi.md similarity index 86% rename from samples/client/petstore/dart/swagger/docs/StoreApi.md rename to samples/client/petstore/dart/openapi-browser-client/docs/StoreApi.md index de492737ace..cc0c2ac2d35 100644 --- a/samples/client/petstore/dart/swagger/docs/StoreApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/docs/StoreApi.md @@ -1,11 +1,11 @@ -# swagger.api.StoreApi +# openapi.api.StoreApi ## Load the API package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -24,7 +24,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new StoreApi(); var orderId = orderId_example; // String | ID of the order that needs to be deleted @@ -53,7 +53,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -66,11 +66,11 @@ Returns a map of status codes to quantities ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +//openapi.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"; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new StoreApi(); @@ -109,7 +109,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new StoreApi(); var orderId = 789; // int | ID of pet that needs to be fetched @@ -144,21 +144,19 @@ No authorization required [[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) +> Order placeOrder(order) Place an order for a pet - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new StoreApi(); -var body = new Order(); // Order | order placed for purchasing the pet +var order = new Order(); // Order | order placed for purchasing the pet try { - var result = api_instance.placeOrder(body); + var result = api_instance.placeOrder(order); print(result); } catch (e) { print("Exception when calling StoreApi->placeOrder: $e\n"); @@ -169,7 +167,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/dart/swagger/docs/Tag.md b/samples/client/petstore/dart/openapi-browser-client/docs/Tag.md similarity index 88% rename from samples/client/petstore/dart/swagger/docs/Tag.md rename to samples/client/petstore/dart/openapi-browser-client/docs/Tag.md index c644f1e826a..ded7b32ac3d 100644 --- a/samples/client/petstore/dart/swagger/docs/Tag.md +++ b/samples/client/petstore/dart/openapi-browser-client/docs/Tag.md @@ -1,8 +1,8 @@ -# swagger.model.Tag +# openapi.model.Tag ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/swagger/docs/User.md b/samples/client/petstore/dart/openapi-browser-client/docs/User.md similarity index 93% rename from samples/client/petstore/dart/swagger/docs/User.md rename to samples/client/petstore/dart/openapi-browser-client/docs/User.md index d49bb37d96c..3761b70cf0b 100644 --- a/samples/client/petstore/dart/swagger/docs/User.md +++ b/samples/client/petstore/dart/openapi-browser-client/docs/User.md @@ -1,8 +1,8 @@ -# swagger.model.User +# openapi.model.User ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/swagger/docs/UserApi.md b/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md similarity index 83% rename from samples/client/petstore/dart/swagger/docs/UserApi.md rename to samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md index 9b71d075453..0dec271be5c 100644 --- a/samples/client/petstore/dart/swagger/docs/UserApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md @@ -1,11 +1,11 @@ -# swagger.api.UserApi +# openapi.api.UserApi ## Load the API package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -20,7 +20,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -28,13 +28,13 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); -var body = new User(); // User | Created user object +var user = new User(); // User | Created user object try { - api_instance.createUser(body); + api_instance.createUser(user); } catch (e) { print("Exception when calling UserApi->createUser: $e\n"); } @@ -44,7 +44,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -57,26 +57,24 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var user = [new List<User>()]; // List | List of user object try { - api_instance.createUsersWithArrayInput(body); + api_instance.createUsersWithArrayInput(user); } catch (e) { print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); } @@ -86,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -99,26 +97,24 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var user = [new List<User>()]; // List | List of user object try { - api_instance.createUsersWithListInput(body); + api_instance.createUsersWithListInput(user); } catch (e) { print("Exception when calling UserApi->createUsersWithListInput: $e\n"); } @@ -128,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -141,7 +137,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -154,7 +150,7 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); var username = username_example; // String | The name that needs to be deleted @@ -183,7 +179,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -192,11 +188,9 @@ No authorization required Get user by user name - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. @@ -235,11 +229,9 @@ No authorization required Logs user into the system - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); var username = username_example; // String | The user name for login @@ -280,11 +272,9 @@ No authorization required Logs out current logged in user session - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); @@ -309,12 +299,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) +> updateUser(username, user) Updated user @@ -322,14 +312,14 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/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 +var user = new User(); // User | Updated user object try { - api_instance.updateUser(username, body); + api_instance.updateUser(username, user); } catch (e) { print("Exception when calling UserApi->updateUser: $e\n"); } @@ -340,7 +330,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -353,7 +343,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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/swagger-browser-client/git_push.sh b/samples/client/petstore/dart/openapi-browser-client/git_push.sh similarity index 94% rename from samples/client/petstore/dart/swagger-browser-client/git_push.sh rename to samples/client/petstore/dart/openapi-browser-client/git_push.sh index ae01b182ae9..8442b80bb44 100644 --- a/samples/client/petstore/dart/swagger-browser-client/git_push.sh +++ b/samples/client/petstore/dart/openapi-browser-client/git_push.sh @@ -1,7 +1,7 @@ #!/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-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/api.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api.dart similarity index 96% rename from samples/client/petstore/dart/swagger-browser-client/lib/api.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/api.dart index 33dd7f750e2..84476e0626a 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/api.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api.dart @@ -1,4 +1,4 @@ -library swagger.api; +library openapi.api; import 'dart:async'; import 'dart:convert'; diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/api/pet_api.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api/pet_api.dart similarity index 93% rename from samples/client/petstore/dart/swagger-browser-client/lib/api/pet_api.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/api/pet_api.dart index 1d7c37382c7..4134e018386 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api/pet_api.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; @@ -10,12 +10,12 @@ class PetApi { /// Add a new pet to the store /// /// - Future addPet(Pet body) async { - Object postBody = body; + Future addPet(Pet pet) async { + Object postBody = pet; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(pet == null) { + throw new ApiException(400, "Missing required param: pet"); } // create path and map variables @@ -25,7 +25,7 @@ class PetApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = ["application/json","application/xml"]; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -34,12 +34,11 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'POST', @@ -53,9 +52,8 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Deletes a pet @@ -86,12 +84,11 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'DELETE', @@ -105,9 +102,8 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Finds Pets by status @@ -129,7 +125,7 @@ class PetApi { Map headerParams = {}; Map formParams = {}; queryParams.addAll(_convertParametersForCollectionFormat("csv", "status", status)); - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -138,12 +134,11 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -157,7 +152,7 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'List') as List ; + return (apiClient.deserialize(response.body, 'List') as List).map((item) => item as Pet).toList(); } else { return null; } @@ -181,7 +176,7 @@ class PetApi { Map headerParams = {}; Map formParams = {}; queryParams.addAll(_convertParametersForCollectionFormat("csv", "tags", tags)); - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -190,12 +185,11 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -209,7 +203,7 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'List') as List ; + return (apiClient.deserialize(response.body, 'List') as List).map((item) => item as Pet).toList(); } else { return null; } @@ -232,7 +226,7 @@ class PetApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -241,12 +235,11 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -260,7 +253,7 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'Pet') as Pet ; + return apiClient.deserialize(response.body, 'Pet') as Pet; } else { return null; } @@ -268,12 +261,12 @@ class PetApi { /// Update an existing pet /// /// - Future updatePet(Pet body) async { - Object postBody = body; + Future updatePet(Pet pet) async { + Object postBody = pet; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(pet == null) { + throw new ApiException(400, "Missing required param: pet"); } // create path and map variables @@ -283,7 +276,7 @@ class PetApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = ["application/json","application/xml"]; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -292,12 +285,11 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'PUT', @@ -311,9 +303,8 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Updates a pet in the store with form data @@ -334,7 +325,7 @@ class PetApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = ["application/x-www-form-urlencoded"]; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -343,24 +334,21 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if (name != null) { hasFields = true; mp.fields['name'] = parameterToString(name); } - if (status != null) { hasFields = true; mp.fields['status'] = parameterToString(status); } - if(hasFields) postBody = mp; } else { if (name != null) formParams['name'] = parameterToString(name); -if (status != null) + if (status != null) formParams['status'] = parameterToString(status); } @@ -376,9 +364,8 @@ if (status != null) if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// uploads an image @@ -399,7 +386,7 @@ if (status != null) List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = ["multipart/form-data"]; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -408,25 +395,21 @@ if (status != null) if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if (additionalMetadata != null) { hasFields = true; mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); } - if (file != null) { hasFields = true; mp.fields['file'] = file.field; mp.files.add(file); } - if(hasFields) postBody = mp; } else { if (additionalMetadata != null) formParams['additionalMetadata'] = parameterToString(additionalMetadata); - } var response = await apiClient.invokeAPI(path, @@ -441,7 +424,7 @@ if (status != null) if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'ApiResponse') as ApiResponse ; + return apiClient.deserialize(response.body, 'ApiResponse') as ApiResponse; } else { return null; } diff --git a/samples/client/petstore/dart/swagger/lib/api/store_api.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api/store_api.dart similarity index 93% rename from samples/client/petstore/dart/swagger/lib/api/store_api.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/api/store_api.dart index 9b1c4d6b6e9..f2a48f2d4da 100644 --- a/samples/client/petstore/dart/swagger/lib/api/store_api.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api/store_api.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; @@ -25,7 +25,7 @@ class StoreApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -34,12 +34,11 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'DELETE', @@ -53,9 +52,8 @@ class StoreApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Returns pet inventories by status @@ -73,7 +71,7 @@ class StoreApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -82,12 +80,11 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -101,7 +98,8 @@ class StoreApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'Map') as Map ; + return new Map.from(apiClient.deserialize(response.body, 'Map')); + ; } else { return null; } @@ -124,7 +122,7 @@ class StoreApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -133,12 +131,11 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -152,7 +149,7 @@ class StoreApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'Order') as Order ; + return apiClient.deserialize(response.body, 'Order') as Order; } else { return null; } @@ -160,12 +157,12 @@ class StoreApi { /// Place an order for a pet /// /// - Future placeOrder(Order body) async { - Object postBody = body; + Future placeOrder(Order order) async { + Object postBody = order; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(order == null) { + throw new ApiException(400, "Missing required param: order"); } // create path and map variables @@ -175,7 +172,7 @@ class StoreApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -184,12 +181,11 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'POST', @@ -203,7 +199,7 @@ class StoreApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'Order') as Order ; + return apiClient.deserialize(response.body, 'Order') as Order; } else { return null; } diff --git a/samples/client/petstore/dart/swagger/lib/api/user_api.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api/user_api.dart similarity index 91% rename from samples/client/petstore/dart/swagger/lib/api/user_api.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/api/user_api.dart index 3632422fecd..cf8ef6bf800 100644 --- a/samples/client/petstore/dart/swagger/lib/api/user_api.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api/user_api.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; @@ -10,12 +10,12 @@ class UserApi { /// Create user /// /// This can only be done by the logged in user. - Future createUser(User body) async { - Object postBody = body; + Future createUser(User user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -25,7 +25,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -34,12 +34,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'POST', @@ -53,20 +52,19 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Creates list of users with given input array /// /// - Future createUsersWithArrayInput(List body) async { - Object postBody = body; + Future createUsersWithArrayInput(List user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -76,7 +74,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -85,12 +83,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'POST', @@ -104,20 +101,19 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Creates list of users with given input array /// /// - Future createUsersWithListInput(List body) async { - Object postBody = body; + Future createUsersWithListInput(List user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -127,7 +123,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -136,12 +132,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'POST', @@ -155,9 +150,8 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Delete user @@ -178,7 +172,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -187,12 +181,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'DELETE', @@ -206,9 +199,8 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Get user by user name @@ -229,7 +221,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -238,12 +230,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -257,7 +248,7 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'User') as User ; + return apiClient.deserialize(response.body, 'User') as User; } else { return null; } @@ -285,7 +276,7 @@ class UserApi { Map formParams = {}; queryParams.addAll(_convertParametersForCollectionFormat("", "username", username)); queryParams.addAll(_convertParametersForCollectionFormat("", "password", password)); - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -294,12 +285,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -313,7 +303,7 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'String') as String ; + return apiClient.deserialize(response.body, 'String') as String; } else { return null; } @@ -333,7 +323,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -342,12 +332,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -361,23 +350,22 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Updated user /// /// This can only be done by the logged in user. - Future updateUser(String username, User body) async { - Object postBody = body; + Future updateUser(String username, User user) async { + Object postBody = user; // verify required params are set if(username == null) { throw new ApiException(400, "Missing required param: username"); } - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -387,7 +375,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -396,12 +384,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'PUT', @@ -415,9 +402,8 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } } diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/api_client.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart similarity index 98% rename from samples/client/petstore/dart/swagger-browser-client/lib/api_client.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart index 679c5f3c75c..7cca5bef5f2 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/api_client.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api_client.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class QueryParam { String name; @@ -18,7 +18,7 @@ class ApiClient { final _RegList = new RegExp(r'^List<(.*)>$'); final _RegMap = new RegExp(r'^Map$'); - ApiClient({this.basePath: "http://localhost/v2"}) { + ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { // Setup authentications (key: authentication name, value: authentication). _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); _authentications['petstore_auth'] = new OAuth(); diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/api_exception.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api_exception.dart similarity index 96% rename from samples/client/petstore/dart/swagger-browser-client/lib/api_exception.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/api_exception.dart index b861591bec0..f188fd125a4 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/api_exception.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api_exception.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class ApiException implements Exception { int code = 0; diff --git a/samples/client/petstore/dart/swagger/lib/api_helper.dart b/samples/client/petstore/dart/openapi-browser-client/lib/api_helper.dart similarity index 98% rename from samples/client/petstore/dart/swagger/lib/api_helper.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/api_helper.dart index 82eb1f3fb36..79af4521d5b 100644 --- a/samples/client/petstore/dart/swagger/lib/api_helper.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/api_helper.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; diff --git a/samples/client/petstore/dart/swagger/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/openapi-browser-client/lib/auth/api_key_auth.dart similarity index 96% rename from samples/client/petstore/dart/swagger/lib/auth/api_key_auth.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/auth/api_key_auth.dart index aacfa9b2d94..f9617f7ae4d 100644 --- a/samples/client/petstore/dart/swagger/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/auth/api_key_auth.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class ApiKeyAuth implements Authentication { diff --git a/samples/client/petstore/dart/swagger/lib/auth/authentication.dart b/samples/client/petstore/dart/openapi-browser-client/lib/auth/authentication.dart similarity index 89% rename from samples/client/petstore/dart/swagger/lib/auth/authentication.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/auth/authentication.dart index b1a7c574cf9..abd5e2fe68a 100644 --- a/samples/client/petstore/dart/swagger/lib/auth/authentication.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/auth/authentication.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; abstract class Authentication { diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/openapi-browser-client/lib/auth/http_basic_auth.dart similarity index 94% rename from samples/client/petstore/dart/swagger-browser-client/lib/auth/http_basic_auth.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/auth/http_basic_auth.dart index 7a118d6cdad..4e77ddcf6e6 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/auth/http_basic_auth.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class HttpBasicAuth implements Authentication { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart b/samples/client/petstore/dart/openapi-browser-client/lib/auth/oauth.dart similarity index 94% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/auth/oauth.dart index 10726213b45..13bfd799743 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/auth/oauth.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class OAuth implements Authentication { String accessToken; diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/model/api_response.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart similarity index 64% rename from samples/client/petstore/dart/swagger-browser-client/lib/model/api_response.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart index 68ed711118e..a39d9500b29 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/model/api_response.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/api_response.dart @@ -1,15 +1,12 @@ -part of swagger.api; +part of openapi.api; class ApiResponse { int code = null; - String type = null; - String message = null; - ApiResponse(); @override @@ -19,12 +16,9 @@ class ApiResponse { ApiResponse.fromJson(Map json) { if (json == null) return; - code = - json['code']; - type = - json['type']; - message = - json['message']; + code = json['code']; + type = json['type']; + message = json['message']; } Map toJson() { @@ -32,15 +26,11 @@ class ApiResponse { 'code': code, 'type': type, 'message': message - }; + }; } - static List listFromJson(List> json) { - var list = new List(); - if (json != null && json.length > 0) { - json.forEach((Map value) => list.add(new ApiResponse.fromJson(value))); - } - return list; + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); } static Map mapFromJson(Map> json) { diff --git a/samples/client/petstore/dart/swagger/lib/model/category.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/category.dart similarity index 64% rename from samples/client/petstore/dart/swagger/lib/model/category.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/model/category.dart index 29855232387..b9b2481dd29 100644 --- a/samples/client/petstore/dart/swagger/lib/model/category.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/category.dart @@ -1,12 +1,10 @@ -part of swagger.api; +part of openapi.api; class Category { int id = null; - String name = null; - Category(); @override @@ -16,25 +14,19 @@ class Category { Category.fromJson(Map json) { if (json == null) return; - id = - json['id']; - name = - json['name']; + id = json['id']; + name = json['name']; } Map toJson() { return { 'id': id, 'name': name - }; + }; } - static List listFromJson(List> json) { - var list = new List(); - if (json != null && json.length > 0) { - json.forEach((Map value) => list.add(new Category.fromJson(value))); - } - return list; + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); } static Map mapFromJson(Map> json) { diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/model/order.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/order.dart similarity index 64% rename from samples/client/petstore/dart/swagger-browser-client/lib/model/order.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/model/order.dart index 852e9e62738..4e264a183ef 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/model/order.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/order.dart @@ -1,24 +1,19 @@ -part of swagger.api; +part of openapi.api; class Order { int id = null; - int petId = null; - int quantity = null; - DateTime shipDate = null; - -/* Order Status */ + /* Order Status */ String status = null; - //enum statusEnum { placed, approved, delivered, }; - - bool complete = null; + //enum statusEnum { placed, approved, delivered, };{ + bool complete = false; Order(); @override @@ -28,17 +23,12 @@ class Order { Order.fromJson(Map json) { if (json == null) return; - id = - json['id']; - petId = - json['petId']; - quantity = - json['quantity']; + id = json['id']; + petId = json['petId']; + quantity = json['quantity']; shipDate = json['shipDate'] == null ? null : DateTime.parse(json['shipDate']); - status = - json['status']; - complete = - json['complete']; + status = json['status']; + complete = json['complete']; } Map toJson() { @@ -49,15 +39,11 @@ class Order { 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), 'status': status, 'complete': complete - }; + }; } - static List listFromJson(List> json) { - var list = new List(); - if (json != null && json.length > 0) { - json.forEach((Map value) => list.add(new Order.fromJson(value))); - } - return list; + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new Order.fromJson(value)).toList(); } static Map mapFromJson(Map> json) { diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/model/pet.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart similarity index 58% rename from samples/client/petstore/dart/swagger-browser-client/lib/model/pet.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart index 85d231848fd..4d2f77a1a5a 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/model/pet.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/pet.dart @@ -1,24 +1,19 @@ -part of swagger.api; +part of openapi.api; class Pet { int id = null; - Category category = null; - String name = null; - List photoUrls = []; - List tags = []; - -/* pet status in the store */ + /* pet status in the store */ String status = null; - //enum statusEnum { available, pending, sold, }; + //enum statusEnum { available, pending, sold, };{ Pet(); @override @@ -28,22 +23,12 @@ class Pet { Pet.fromJson(Map json) { if (json == null) return; - id = - json['id']; - category = - - - new Category.fromJson(json['category']) - ; - name = - json['name']; - photoUrls = - json['photoUrls']; - tags = - Tag.listFromJson(json['tags']) - ; - status = - json['status']; + id = json['id']; + category = new Category.fromJson(json['category']); + name = json['name']; + photoUrls = (json['photoUrls'] as List).map((item) => item as String).toList(); + tags = Tag.listFromJson(json['tags']); + status = json['status']; } Map toJson() { @@ -54,15 +39,11 @@ class Pet { 'photoUrls': photoUrls, 'tags': tags, 'status': status - }; + }; } - static List listFromJson(List> json) { - var list = new List(); - if (json != null && json.length > 0) { - json.forEach((Map value) => list.add(new Pet.fromJson(value))); - } - return list; + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); } static Map mapFromJson(Map> json) { diff --git a/samples/client/petstore/dart/swagger/lib/model/tag.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/tag.dart similarity index 64% rename from samples/client/petstore/dart/swagger/lib/model/tag.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/model/tag.dart index ed2828f9069..315a326adb7 100644 --- a/samples/client/petstore/dart/swagger/lib/model/tag.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/tag.dart @@ -1,12 +1,10 @@ -part of swagger.api; +part of openapi.api; class Tag { int id = null; - String name = null; - Tag(); @override @@ -16,25 +14,19 @@ class Tag { Tag.fromJson(Map json) { if (json == null) return; - id = - json['id']; - name = - json['name']; + id = json['id']; + name = json['name']; } Map toJson() { return { 'id': id, 'name': name - }; + }; } - static List listFromJson(List> json) { - var list = new List(); - if (json != null && json.length > 0) { - json.forEach((Map value) => list.add(new Tag.fromJson(value))); - } - return list; + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); } static Map mapFromJson(Map> json) { diff --git a/samples/client/petstore/dart/swagger/lib/model/user.dart b/samples/client/petstore/dart/openapi-browser-client/lib/model/user.dart similarity index 64% rename from samples/client/petstore/dart/swagger/lib/model/user.dart rename to samples/client/petstore/dart/openapi-browser-client/lib/model/user.dart index a4d049b97e7..0e4cc2104c7 100644 --- a/samples/client/petstore/dart/swagger/lib/model/user.dart +++ b/samples/client/petstore/dart/openapi-browser-client/lib/model/user.dart @@ -1,30 +1,22 @@ -part of swagger.api; +part of openapi.api; class User { int id = null; - String username = null; - String firstName = null; - String lastName = null; - String email = null; - String password = null; - String phone = null; - -/* User Status */ + /* User Status */ int userStatus = null; - User(); @override @@ -34,22 +26,14 @@ class User { User.fromJson(Map json) { if (json == null) return; - id = - json['id']; - username = - json['username']; - firstName = - json['firstName']; - lastName = - json['lastName']; - email = - json['email']; - password = - json['password']; - phone = - json['phone']; - userStatus = - json['userStatus']; + id = json['id']; + username = json['username']; + firstName = json['firstName']; + lastName = json['lastName']; + email = json['email']; + password = json['password']; + phone = json['phone']; + userStatus = json['userStatus']; } Map toJson() { @@ -62,15 +46,11 @@ class User { 'password': password, 'phone': phone, 'userStatus': userStatus - }; + }; } - static List listFromJson(List> json) { - var list = new List(); - if (json != null && json.length > 0) { - json.forEach((Map value) => list.add(new User.fromJson(value))); - } - return list; + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new User.fromJson(value)).toList(); } static Map mapFromJson(Map> json) { diff --git a/samples/client/petstore/dart/swagger-browser-client/pubspec.yaml b/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml similarity index 54% rename from samples/client/petstore/dart/swagger-browser-client/pubspec.yaml rename to samples/client/petstore/dart/openapi-browser-client/pubspec.yaml index 1f94390bbb7..d54efb46a2e 100644 --- a/samples/client/petstore/dart/swagger-browser-client/pubspec.yaml +++ b/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml @@ -1,5 +1,5 @@ -name: swagger +name: openapi version: 1.0.0 -description: Swagger API client +description: OpenAPI API client dependencies: http: '>=0.11.1 <0.12.0' diff --git a/samples/client/petstore/dart/openapi/.analysis_options b/samples/client/petstore/dart/openapi/.analysis_options new file mode 100644 index 00000000000..518eb901a6f --- /dev/null +++ b/samples/client/petstore/dart/openapi/.analysis_options @@ -0,0 +1,2 @@ +analyzer: + strong-mode: true \ No newline at end of file diff --git a/samples/client/petstore/dart/swagger/.gitignore b/samples/client/petstore/dart/openapi/.gitignore similarity index 100% rename from samples/client/petstore/dart/swagger/.gitignore rename to samples/client/petstore/dart/openapi/.gitignore diff --git a/samples/client/petstore/dart/openapi/.openapi-generator-ignore b/samples/client/petstore/dart/openapi/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/client/petstore/dart/openapi/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# 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 OpenAPI Generator 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/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION new file mode 100644 index 00000000000..096bf47efe3 --- /dev/null +++ b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION @@ -0,0 +1 @@ +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/swagger-browser-client/README.md b/samples/client/petstore/dart/openapi/README.md similarity index 88% rename from samples/client/petstore/dart/swagger-browser-client/README.md rename to samples/client/petstore/dart/openapi/README.md index 2136cafdd5d..290d1cc7a4b 100644 --- a/samples/client/petstore/dart/swagger-browser-client/README.md +++ b/samples/client/petstore/dart/openapi/README.md @@ -1,10 +1,10 @@ -# swagger +# openapi 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: +This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- Build package: io.swagger.codegen.languages.DartClientCodegen +- Build package: org.openapitools.codegen.languages.DartClientCodegen ## Requirements @@ -15,11 +15,11 @@ Dart 1.20.0 or later OR Flutter 0.0.20 or later ### Github If this Dart package is published to Github, please include the following in pubspec.yaml ``` -name: swagger +name: openapi version: 1.0.0 -description: Swagger API client +description: OpenAPI API client dependencies: - swagger: + openapi: git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git version: 'any' ``` @@ -28,8 +28,8 @@ dependencies: To use the package in your local drive, please include the following in pubspec.yaml ``` dependencies: - swagger: - path: /path/to/swagger + openapi: + path: /path/to/openapi ``` ## Tests @@ -41,16 +41,16 @@ TODO Please follow the [installation procedure](#installation--usage) and then run the following: ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.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 +var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(body); + api_instance.addPet(pet); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -59,7 +59,7 @@ try { ## Documentation for API Endpoints -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/dart/swagger-browser-client/docs/ApiResponse.md b/samples/client/petstore/dart/openapi/docs/ApiResponse.md similarity index 88% rename from samples/client/petstore/dart/swagger-browser-client/docs/ApiResponse.md rename to samples/client/petstore/dart/openapi/docs/ApiResponse.md index 7bc0c834d78..92422f0f446 100644 --- a/samples/client/petstore/dart/swagger-browser-client/docs/ApiResponse.md +++ b/samples/client/petstore/dart/openapi/docs/ApiResponse.md @@ -1,8 +1,8 @@ -# swagger.model.ApiResponse +# openapi.model.ApiResponse ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/Category.md b/samples/client/petstore/dart/openapi/docs/Category.md similarity index 87% rename from samples/client/petstore/dart/flutter_petstore/swagger/docs/Category.md rename to samples/client/petstore/dart/openapi/docs/Category.md index 3f5d01c5e1c..cc0d1633b59 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/Category.md +++ b/samples/client/petstore/dart/openapi/docs/Category.md @@ -1,8 +1,8 @@ -# swagger.model.Category +# openapi.model.Category ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/swagger-browser-client/docs/Order.md b/samples/client/petstore/dart/openapi/docs/Order.md similarity index 84% rename from samples/client/petstore/dart/swagger-browser-client/docs/Order.md rename to samples/client/petstore/dart/openapi/docs/Order.md index c076322a76e..310ce6c65be 100644 --- a/samples/client/petstore/dart/swagger-browser-client/docs/Order.md +++ b/samples/client/petstore/dart/openapi/docs/Order.md @@ -1,8 +1,8 @@ -# swagger.model.Order +# openapi.model.Order ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties @@ -13,7 +13,7 @@ Name | Type | Description | Notes **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] +**complete** | **bool** | | [optional] [default to false] [[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/swagger-browser-client/docs/Pet.md b/samples/client/petstore/dart/openapi/docs/Pet.md similarity index 92% rename from samples/client/petstore/dart/swagger-browser-client/docs/Pet.md rename to samples/client/petstore/dart/openapi/docs/Pet.md index 3f8629fbd43..191e1fc66a9 100644 --- a/samples/client/petstore/dart/swagger-browser-client/docs/Pet.md +++ b/samples/client/petstore/dart/openapi/docs/Pet.md @@ -1,8 +1,8 @@ -# swagger.model.Pet +# openapi.model.Pet ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/swagger-browser-client/docs/PetApi.md b/samples/client/petstore/dart/openapi/docs/PetApi.md similarity index 83% rename from samples/client/petstore/dart/swagger-browser-client/docs/PetApi.md rename to samples/client/petstore/dart/openapi/docs/PetApi.md index 6f353923e87..6fa9abf67ae 100644 --- a/samples/client/petstore/dart/swagger-browser-client/docs/PetApi.md +++ b/samples/client/petstore/dart/openapi/docs/PetApi.md @@ -1,11 +1,11 @@ -# swagger.api.PetApi +# openapi.api.PetApi ## Load the API package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -20,23 +20,21 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.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 +var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(body); + api_instance.addPet(pet); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -46,7 +44,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -59,7 +57,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -68,13 +66,11 @@ void (empty response body) Deletes a pet - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var petId = 789; // int | Pet id to delete @@ -105,7 +101,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -118,9 +114,9 @@ Multiple status values can be provided with comma separated strings ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var status = []; // List | Status values that need to be considered for filter @@ -163,9 +159,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var tags = []; // List | Tags to filter by @@ -208,11 +204,11 @@ Returns a single pet ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +//openapi.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"; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new PetApi(); var petId = 789; // int | ID of pet to return @@ -247,23 +243,21 @@ Name | Type | Description | Notes [[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) +> updatePet(pet) Update an existing pet - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.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 +var pet = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.updatePet(body); + api_instance.updatePet(pet); } catch (e) { print("Exception when calling PetApi->updatePet: $e\n"); } @@ -273,7 +267,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -286,7 +280,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -295,13 +289,11 @@ void (empty response body) Updates a pet in the store with form data - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; var api_instance = new PetApi(); var petId = 789; // int | ID of pet that needs to be updated @@ -320,8 +312,8 @@ try { 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] + **name** | **String**| Updated name of the pet | [optional] [default to null] + **status** | **String**| Updated status of the pet | [optional] [default to null] ### Return type @@ -334,7 +326,7 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -343,18 +335,16 @@ void (empty response body) uploads an image - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//swagger.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.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 +var file = BINARY_DATA_HERE; // MultipartFile | file to upload try { var result = api_instance.uploadFile(petId, additionalMetadata, file); @@ -369,8 +359,8 @@ try { 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] + **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] + **file** | **MultipartFile**| file to upload | [optional] [default to null] ### Return type diff --git a/samples/client/petstore/dart/swagger-browser-client/docs/StoreApi.md b/samples/client/petstore/dart/openapi/docs/StoreApi.md similarity index 86% rename from samples/client/petstore/dart/swagger-browser-client/docs/StoreApi.md rename to samples/client/petstore/dart/openapi/docs/StoreApi.md index de492737ace..cc0c2ac2d35 100644 --- a/samples/client/petstore/dart/swagger-browser-client/docs/StoreApi.md +++ b/samples/client/petstore/dart/openapi/docs/StoreApi.md @@ -1,11 +1,11 @@ -# swagger.api.StoreApi +# openapi.api.StoreApi ## Load the API package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -24,7 +24,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new StoreApi(); var orderId = orderId_example; // String | ID of the order that needs to be deleted @@ -53,7 +53,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -66,11 +66,11 @@ Returns a map of status codes to quantities ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//swagger.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; +//openapi.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"; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; var api_instance = new StoreApi(); @@ -109,7 +109,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new StoreApi(); var orderId = 789; // int | ID of pet that needs to be fetched @@ -144,21 +144,19 @@ No authorization required [[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) +> Order placeOrder(order) Place an order for a pet - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new StoreApi(); -var body = new Order(); // Order | order placed for purchasing the pet +var order = new Order(); // Order | order placed for purchasing the pet try { - var result = api_instance.placeOrder(body); + var result = api_instance.placeOrder(order); print(result); } catch (e) { print("Exception when calling StoreApi->placeOrder: $e\n"); @@ -169,7 +167,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/dart/swagger-browser-client/docs/Tag.md b/samples/client/petstore/dart/openapi/docs/Tag.md similarity index 88% rename from samples/client/petstore/dart/swagger-browser-client/docs/Tag.md rename to samples/client/petstore/dart/openapi/docs/Tag.md index c644f1e826a..ded7b32ac3d 100644 --- a/samples/client/petstore/dart/swagger-browser-client/docs/Tag.md +++ b/samples/client/petstore/dart/openapi/docs/Tag.md @@ -1,8 +1,8 @@ -# swagger.model.Tag +# openapi.model.Tag ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/swagger-browser-client/docs/User.md b/samples/client/petstore/dart/openapi/docs/User.md similarity index 93% rename from samples/client/petstore/dart/swagger-browser-client/docs/User.md rename to samples/client/petstore/dart/openapi/docs/User.md index d49bb37d96c..3761b70cf0b 100644 --- a/samples/client/petstore/dart/swagger-browser-client/docs/User.md +++ b/samples/client/petstore/dart/openapi/docs/User.md @@ -1,8 +1,8 @@ -# swagger.model.User +# openapi.model.User ## Load the model package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` ## Properties diff --git a/samples/client/petstore/dart/swagger-browser-client/docs/UserApi.md b/samples/client/petstore/dart/openapi/docs/UserApi.md similarity index 83% rename from samples/client/petstore/dart/swagger-browser-client/docs/UserApi.md rename to samples/client/petstore/dart/openapi/docs/UserApi.md index 9b71d075453..0dec271be5c 100644 --- a/samples/client/petstore/dart/swagger-browser-client/docs/UserApi.md +++ b/samples/client/petstore/dart/openapi/docs/UserApi.md @@ -1,11 +1,11 @@ -# swagger.api.UserApi +# openapi.api.UserApi ## Load the API package ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; ``` -All URIs are relative to *http://localhost/v2* +All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -20,7 +20,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -28,13 +28,13 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); -var body = new User(); // User | Created user object +var user = new User(); // User | Created user object try { - api_instance.createUser(body); + api_instance.createUser(user); } catch (e) { print("Exception when calling UserApi->createUser: $e\n"); } @@ -44,7 +44,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -57,26 +57,24 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var user = [new List<User>()]; // List | List of user object try { - api_instance.createUsersWithArrayInput(body); + api_instance.createUsersWithArrayInput(user); } catch (e) { print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); } @@ -86,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -99,26 +97,24 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var user = [new List<User>()]; // List | List of user object try { - api_instance.createUsersWithListInput(body); + api_instance.createUsersWithListInput(user); } catch (e) { print("Exception when calling UserApi->createUsersWithListInput: $e\n"); } @@ -128,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | + **user** | [**List<User>**](List.md)| List of user object | ### Return type @@ -141,7 +137,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -154,7 +150,7 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); var username = username_example; // String | The name that needs to be deleted @@ -183,7 +179,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) @@ -192,11 +188,9 @@ No authorization required Get user by user name - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. @@ -235,11 +229,9 @@ No authorization required Logs user into the system - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); var username = username_example; // String | The user name for login @@ -280,11 +272,9 @@ No authorization required Logs out current logged in user session - - ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; var api_instance = new UserApi(); @@ -309,12 +299,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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) +> updateUser(username, user) Updated user @@ -322,14 +312,14 @@ This can only be done by the logged in user. ### Example ```dart -import 'package:swagger/api.dart'; +import 'package:openapi/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 +var user = new User(); // User | Updated user object try { - api_instance.updateUser(username, body); + api_instance.updateUser(username, user); } catch (e) { print("Exception when calling UserApi->updateUser: $e\n"); } @@ -340,7 +330,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -353,7 +343,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined [[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/swagger/git_push.sh b/samples/client/petstore/dart/openapi/git_push.sh similarity index 94% rename from samples/client/petstore/dart/swagger/git_push.sh rename to samples/client/petstore/dart/openapi/git_push.sh index ae01b182ae9..8442b80bb44 100644 --- a/samples/client/petstore/dart/swagger/git_push.sh +++ b/samples/client/petstore/dart/openapi/git_push.sh @@ -1,7 +1,7 @@ #!/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-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" git_user_id=$1 git_repo_id=$2 diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api.dart b/samples/client/petstore/dart/openapi/lib/api.dart similarity index 96% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api.dart rename to samples/client/petstore/dart/openapi/lib/api.dart index 6853e7c628f..9a64a5342b4 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api.dart +++ b/samples/client/petstore/dart/openapi/lib/api.dart @@ -1,4 +1,4 @@ -library swagger.api; +library openapi.api; import 'dart:async'; import 'dart:convert'; diff --git a/samples/client/petstore/dart/swagger/lib/api/pet_api.dart b/samples/client/petstore/dart/openapi/lib/api/pet_api.dart similarity index 93% rename from samples/client/petstore/dart/swagger/lib/api/pet_api.dart rename to samples/client/petstore/dart/openapi/lib/api/pet_api.dart index 1d7c37382c7..4134e018386 100644 --- a/samples/client/petstore/dart/swagger/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/openapi/lib/api/pet_api.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; @@ -10,12 +10,12 @@ class PetApi { /// Add a new pet to the store /// /// - Future addPet(Pet body) async { - Object postBody = body; + Future addPet(Pet pet) async { + Object postBody = pet; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(pet == null) { + throw new ApiException(400, "Missing required param: pet"); } // create path and map variables @@ -25,7 +25,7 @@ class PetApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = ["application/json","application/xml"]; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -34,12 +34,11 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'POST', @@ -53,9 +52,8 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Deletes a pet @@ -86,12 +84,11 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'DELETE', @@ -105,9 +102,8 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Finds Pets by status @@ -129,7 +125,7 @@ class PetApi { Map headerParams = {}; Map formParams = {}; queryParams.addAll(_convertParametersForCollectionFormat("csv", "status", status)); - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -138,12 +134,11 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -157,7 +152,7 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'List') as List ; + return (apiClient.deserialize(response.body, 'List') as List).map((item) => item as Pet).toList(); } else { return null; } @@ -181,7 +176,7 @@ class PetApi { Map headerParams = {}; Map formParams = {}; queryParams.addAll(_convertParametersForCollectionFormat("csv", "tags", tags)); - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -190,12 +185,11 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -209,7 +203,7 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'List') as List ; + return (apiClient.deserialize(response.body, 'List') as List).map((item) => item as Pet).toList(); } else { return null; } @@ -232,7 +226,7 @@ class PetApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -241,12 +235,11 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -260,7 +253,7 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'Pet') as Pet ; + return apiClient.deserialize(response.body, 'Pet') as Pet; } else { return null; } @@ -268,12 +261,12 @@ class PetApi { /// Update an existing pet /// /// - Future updatePet(Pet body) async { - Object postBody = body; + Future updatePet(Pet pet) async { + Object postBody = pet; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(pet == null) { + throw new ApiException(400, "Missing required param: pet"); } // create path and map variables @@ -283,7 +276,7 @@ class PetApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = ["application/json","application/xml"]; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -292,12 +285,11 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'PUT', @@ -311,9 +303,8 @@ class PetApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Updates a pet in the store with form data @@ -334,7 +325,7 @@ class PetApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = ["application/x-www-form-urlencoded"]; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -343,24 +334,21 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if (name != null) { hasFields = true; mp.fields['name'] = parameterToString(name); } - if (status != null) { hasFields = true; mp.fields['status'] = parameterToString(status); } - if(hasFields) postBody = mp; } else { if (name != null) formParams['name'] = parameterToString(name); -if (status != null) + if (status != null) formParams['status'] = parameterToString(status); } @@ -376,9 +364,8 @@ if (status != null) if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// uploads an image @@ -399,7 +386,7 @@ if (status != null) List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = ["multipart/form-data"]; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -408,25 +395,21 @@ if (status != null) if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if (additionalMetadata != null) { hasFields = true; mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); } - if (file != null) { hasFields = true; mp.fields['file'] = file.field; mp.files.add(file); } - if(hasFields) postBody = mp; } else { if (additionalMetadata != null) formParams['additionalMetadata'] = parameterToString(additionalMetadata); - } var response = await apiClient.invokeAPI(path, @@ -441,7 +424,7 @@ if (status != null) if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'ApiResponse') as ApiResponse ; + return apiClient.deserialize(response.body, 'ApiResponse') as ApiResponse; } else { return null; } diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/api/store_api.dart b/samples/client/petstore/dart/openapi/lib/api/store_api.dart similarity index 93% rename from samples/client/petstore/dart/swagger-browser-client/lib/api/store_api.dart rename to samples/client/petstore/dart/openapi/lib/api/store_api.dart index 9b1c4d6b6e9..f2a48f2d4da 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/api/store_api.dart +++ b/samples/client/petstore/dart/openapi/lib/api/store_api.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; @@ -25,7 +25,7 @@ class StoreApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -34,12 +34,11 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'DELETE', @@ -53,9 +52,8 @@ class StoreApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Returns pet inventories by status @@ -73,7 +71,7 @@ class StoreApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -82,12 +80,11 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -101,7 +98,8 @@ class StoreApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'Map') as Map ; + return new Map.from(apiClient.deserialize(response.body, 'Map')); + ; } else { return null; } @@ -124,7 +122,7 @@ class StoreApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -133,12 +131,11 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -152,7 +149,7 @@ class StoreApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'Order') as Order ; + return apiClient.deserialize(response.body, 'Order') as Order; } else { return null; } @@ -160,12 +157,12 @@ class StoreApi { /// Place an order for a pet /// /// - Future placeOrder(Order body) async { - Object postBody = body; + Future placeOrder(Order order) async { + Object postBody = order; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(order == null) { + throw new ApiException(400, "Missing required param: order"); } // create path and map variables @@ -175,7 +172,7 @@ class StoreApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -184,12 +181,11 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'POST', @@ -203,7 +199,7 @@ class StoreApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'Order') as Order ; + return apiClient.deserialize(response.body, 'Order') as Order; } else { return null; } diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/api/user_api.dart b/samples/client/petstore/dart/openapi/lib/api/user_api.dart similarity index 91% rename from samples/client/petstore/dart/swagger-browser-client/lib/api/user_api.dart rename to samples/client/petstore/dart/openapi/lib/api/user_api.dart index 3632422fecd..cf8ef6bf800 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/api/user_api.dart +++ b/samples/client/petstore/dart/openapi/lib/api/user_api.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; @@ -10,12 +10,12 @@ class UserApi { /// Create user /// /// This can only be done by the logged in user. - Future createUser(User body) async { - Object postBody = body; + Future createUser(User user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -25,7 +25,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -34,12 +34,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'POST', @@ -53,20 +52,19 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Creates list of users with given input array /// /// - Future createUsersWithArrayInput(List body) async { - Object postBody = body; + Future createUsersWithArrayInput(List user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -76,7 +74,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -85,12 +83,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'POST', @@ -104,20 +101,19 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Creates list of users with given input array /// /// - Future createUsersWithListInput(List body) async { - Object postBody = body; + Future createUsersWithListInput(List user) async { + Object postBody = user; // verify required params are set - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -127,7 +123,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -136,12 +132,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'POST', @@ -155,9 +150,8 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Delete user @@ -178,7 +172,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -187,12 +181,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'DELETE', @@ -206,9 +199,8 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Get user by user name @@ -229,7 +221,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -238,12 +230,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -257,7 +248,7 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'User') as User ; + return apiClient.deserialize(response.body, 'User') as User; } else { return null; } @@ -285,7 +276,7 @@ class UserApi { Map formParams = {}; queryParams.addAll(_convertParametersForCollectionFormat("", "username", username)); queryParams.addAll(_convertParametersForCollectionFormat("", "password", password)); - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -294,12 +285,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -313,7 +303,7 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return apiClient.deserialize(response.body, 'String') as String ; + return apiClient.deserialize(response.body, 'String') as String; } else { return null; } @@ -333,7 +323,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -342,12 +332,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'GET', @@ -361,23 +350,22 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } /// Updated user /// /// This can only be done by the logged in user. - Future updateUser(String username, User body) async { - Object postBody = body; + Future updateUser(String username, User user) async { + Object postBody = user; // verify required params are set if(username == null) { throw new ApiException(400, "Missing required param: username"); } - if(body == null) { - throw new ApiException(400, "Missing required param: body"); + if(user == null) { + throw new ApiException(400, "Missing required param: user"); } // create path and map variables @@ -387,7 +375,7 @@ class UserApi { List queryParams = []; Map headerParams = {}; Map formParams = {}; - + List contentTypes = []; String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; @@ -396,12 +384,11 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; MultipartRequest mp = new MultipartRequest(null, null); - if(hasFields) postBody = mp; } else { - } + } var response = await apiClient.invokeAPI(path, 'PUT', @@ -415,9 +402,8 @@ class UserApi { if(response.statusCode >= 400) { throw new ApiException(response.statusCode, response.body); } else if(response.body != null) { - return ; } else { - return ; + return; } } } diff --git a/samples/client/petstore/dart/swagger/lib/api_client.dart b/samples/client/petstore/dart/openapi/lib/api_client.dart similarity index 98% rename from samples/client/petstore/dart/swagger/lib/api_client.dart rename to samples/client/petstore/dart/openapi/lib/api_client.dart index 4888f158f55..db4116dd96d 100644 --- a/samples/client/petstore/dart/swagger/lib/api_client.dart +++ b/samples/client/petstore/dart/openapi/lib/api_client.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class QueryParam { String name; @@ -18,7 +18,7 @@ class ApiClient { final _RegList = new RegExp(r'^List<(.*)>$'); final _RegMap = new RegExp(r'^Map$'); - ApiClient({this.basePath: "http://localhost/v2"}) { + ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { // Setup authentications (key: authentication name, value: authentication). _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); _authentications['petstore_auth'] = new OAuth(); diff --git a/samples/client/petstore/dart/swagger/lib/api_exception.dart b/samples/client/petstore/dart/openapi/lib/api_exception.dart similarity index 96% rename from samples/client/petstore/dart/swagger/lib/api_exception.dart rename to samples/client/petstore/dart/openapi/lib/api_exception.dart index b861591bec0..f188fd125a4 100644 --- a/samples/client/petstore/dart/swagger/lib/api_exception.dart +++ b/samples/client/petstore/dart/openapi/lib/api_exception.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class ApiException implements Exception { int code = 0; diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_helper.dart b/samples/client/petstore/dart/openapi/lib/api_helper.dart similarity index 98% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/api_helper.dart rename to samples/client/petstore/dart/openapi/lib/api_helper.dart index 82eb1f3fb36..79af4521d5b 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_helper.dart +++ b/samples/client/petstore/dart/openapi/lib/api_helper.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; const _delimiters = const {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'}; diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/openapi/lib/auth/api_key_auth.dart similarity index 96% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/api_key_auth.dart rename to samples/client/petstore/dart/openapi/lib/auth/api_key_auth.dart index aacfa9b2d94..f9617f7ae4d 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/openapi/lib/auth/api_key_auth.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class ApiKeyAuth implements Authentication { diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/auth/authentication.dart b/samples/client/petstore/dart/openapi/lib/auth/authentication.dart similarity index 89% rename from samples/client/petstore/dart/swagger-browser-client/lib/auth/authentication.dart rename to samples/client/petstore/dart/openapi/lib/auth/authentication.dart index b1a7c574cf9..abd5e2fe68a 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/auth/authentication.dart +++ b/samples/client/petstore/dart/openapi/lib/auth/authentication.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; abstract class Authentication { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/openapi/lib/auth/http_basic_auth.dart similarity index 94% rename from samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/http_basic_auth.dart rename to samples/client/petstore/dart/openapi/lib/auth/http_basic_auth.dart index 7a118d6cdad..4e77ddcf6e6 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/openapi/lib/auth/http_basic_auth.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class HttpBasicAuth implements Authentication { diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/auth/oauth.dart b/samples/client/petstore/dart/openapi/lib/auth/oauth.dart similarity index 94% rename from samples/client/petstore/dart/swagger-browser-client/lib/auth/oauth.dart rename to samples/client/petstore/dart/openapi/lib/auth/oauth.dart index 10726213b45..13bfd799743 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/openapi/lib/auth/oauth.dart @@ -1,4 +1,4 @@ -part of swagger.api; +part of openapi.api; class OAuth implements Authentication { String accessToken; diff --git a/samples/client/petstore/dart/swagger/lib/model/api_response.dart b/samples/client/petstore/dart/openapi/lib/model/api_response.dart similarity index 64% rename from samples/client/petstore/dart/swagger/lib/model/api_response.dart rename to samples/client/petstore/dart/openapi/lib/model/api_response.dart index 68ed711118e..a39d9500b29 100644 --- a/samples/client/petstore/dart/swagger/lib/model/api_response.dart +++ b/samples/client/petstore/dart/openapi/lib/model/api_response.dart @@ -1,15 +1,12 @@ -part of swagger.api; +part of openapi.api; class ApiResponse { int code = null; - String type = null; - String message = null; - ApiResponse(); @override @@ -19,12 +16,9 @@ class ApiResponse { ApiResponse.fromJson(Map json) { if (json == null) return; - code = - json['code']; - type = - json['type']; - message = - json['message']; + code = json['code']; + type = json['type']; + message = json['message']; } Map toJson() { @@ -32,15 +26,11 @@ class ApiResponse { 'code': code, 'type': type, 'message': message - }; + }; } - static List listFromJson(List> json) { - var list = new List(); - if (json != null && json.length > 0) { - json.forEach((Map value) => list.add(new ApiResponse.fromJson(value))); - } - return list; + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); } static Map mapFromJson(Map> json) { diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/model/category.dart b/samples/client/petstore/dart/openapi/lib/model/category.dart similarity index 64% rename from samples/client/petstore/dart/swagger-browser-client/lib/model/category.dart rename to samples/client/petstore/dart/openapi/lib/model/category.dart index 29855232387..b9b2481dd29 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/model/category.dart +++ b/samples/client/petstore/dart/openapi/lib/model/category.dart @@ -1,12 +1,10 @@ -part of swagger.api; +part of openapi.api; class Category { int id = null; - String name = null; - Category(); @override @@ -16,25 +14,19 @@ class Category { Category.fromJson(Map json) { if (json == null) return; - id = - json['id']; - name = - json['name']; + id = json['id']; + name = json['name']; } Map toJson() { return { 'id': id, 'name': name - }; + }; } - static List listFromJson(List> json) { - var list = new List(); - if (json != null && json.length > 0) { - json.forEach((Map value) => list.add(new Category.fromJson(value))); - } - return list; + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); } static Map mapFromJson(Map> json) { diff --git a/samples/client/petstore/dart/swagger/lib/model/order.dart b/samples/client/petstore/dart/openapi/lib/model/order.dart similarity index 64% rename from samples/client/petstore/dart/swagger/lib/model/order.dart rename to samples/client/petstore/dart/openapi/lib/model/order.dart index 852e9e62738..4e264a183ef 100644 --- a/samples/client/petstore/dart/swagger/lib/model/order.dart +++ b/samples/client/petstore/dart/openapi/lib/model/order.dart @@ -1,24 +1,19 @@ -part of swagger.api; +part of openapi.api; class Order { int id = null; - int petId = null; - int quantity = null; - DateTime shipDate = null; - -/* Order Status */ + /* Order Status */ String status = null; - //enum statusEnum { placed, approved, delivered, }; - - bool complete = null; + //enum statusEnum { placed, approved, delivered, };{ + bool complete = false; Order(); @override @@ -28,17 +23,12 @@ class Order { Order.fromJson(Map json) { if (json == null) return; - id = - json['id']; - petId = - json['petId']; - quantity = - json['quantity']; + id = json['id']; + petId = json['petId']; + quantity = json['quantity']; shipDate = json['shipDate'] == null ? null : DateTime.parse(json['shipDate']); - status = - json['status']; - complete = - json['complete']; + status = json['status']; + complete = json['complete']; } Map toJson() { @@ -49,15 +39,11 @@ class Order { 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), 'status': status, 'complete': complete - }; + }; } - static List listFromJson(List> json) { - var list = new List(); - if (json != null && json.length > 0) { - json.forEach((Map value) => list.add(new Order.fromJson(value))); - } - return list; + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new Order.fromJson(value)).toList(); } static Map mapFromJson(Map> json) { diff --git a/samples/client/petstore/dart/swagger/lib/model/pet.dart b/samples/client/petstore/dart/openapi/lib/model/pet.dart similarity index 58% rename from samples/client/petstore/dart/swagger/lib/model/pet.dart rename to samples/client/petstore/dart/openapi/lib/model/pet.dart index 85d231848fd..4d2f77a1a5a 100644 --- a/samples/client/petstore/dart/swagger/lib/model/pet.dart +++ b/samples/client/petstore/dart/openapi/lib/model/pet.dart @@ -1,24 +1,19 @@ -part of swagger.api; +part of openapi.api; class Pet { int id = null; - Category category = null; - String name = null; - List photoUrls = []; - List tags = []; - -/* pet status in the store */ + /* pet status in the store */ String status = null; - //enum statusEnum { available, pending, sold, }; + //enum statusEnum { available, pending, sold, };{ Pet(); @override @@ -28,22 +23,12 @@ class Pet { Pet.fromJson(Map json) { if (json == null) return; - id = - json['id']; - category = - - - new Category.fromJson(json['category']) - ; - name = - json['name']; - photoUrls = - json['photoUrls']; - tags = - Tag.listFromJson(json['tags']) - ; - status = - json['status']; + id = json['id']; + category = new Category.fromJson(json['category']); + name = json['name']; + photoUrls = (json['photoUrls'] as List).map((item) => item as String).toList(); + tags = Tag.listFromJson(json['tags']); + status = json['status']; } Map toJson() { @@ -54,15 +39,11 @@ class Pet { 'photoUrls': photoUrls, 'tags': tags, 'status': status - }; + }; } - static List listFromJson(List> json) { - var list = new List(); - if (json != null && json.length > 0) { - json.forEach((Map value) => list.add(new Pet.fromJson(value))); - } - return list; + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); } static Map mapFromJson(Map> json) { diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/model/tag.dart b/samples/client/petstore/dart/openapi/lib/model/tag.dart similarity index 64% rename from samples/client/petstore/dart/swagger-browser-client/lib/model/tag.dart rename to samples/client/petstore/dart/openapi/lib/model/tag.dart index ed2828f9069..315a326adb7 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/model/tag.dart +++ b/samples/client/petstore/dart/openapi/lib/model/tag.dart @@ -1,12 +1,10 @@ -part of swagger.api; +part of openapi.api; class Tag { int id = null; - String name = null; - Tag(); @override @@ -16,25 +14,19 @@ class Tag { Tag.fromJson(Map json) { if (json == null) return; - id = - json['id']; - name = - json['name']; + id = json['id']; + name = json['name']; } Map toJson() { return { 'id': id, 'name': name - }; + }; } - static List listFromJson(List> json) { - var list = new List(); - if (json != null && json.length > 0) { - json.forEach((Map value) => list.add(new Tag.fromJson(value))); - } - return list; + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); } static Map mapFromJson(Map> json) { diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/model/user.dart b/samples/client/petstore/dart/openapi/lib/model/user.dart similarity index 64% rename from samples/client/petstore/dart/swagger-browser-client/lib/model/user.dart rename to samples/client/petstore/dart/openapi/lib/model/user.dart index a4d049b97e7..0e4cc2104c7 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/model/user.dart +++ b/samples/client/petstore/dart/openapi/lib/model/user.dart @@ -1,30 +1,22 @@ -part of swagger.api; +part of openapi.api; class User { int id = null; - String username = null; - String firstName = null; - String lastName = null; - String email = null; - String password = null; - String phone = null; - -/* User Status */ + /* User Status */ int userStatus = null; - User(); @override @@ -34,22 +26,14 @@ class User { User.fromJson(Map json) { if (json == null) return; - id = - json['id']; - username = - json['username']; - firstName = - json['firstName']; - lastName = - json['lastName']; - email = - json['email']; - password = - json['password']; - phone = - json['phone']; - userStatus = - json['userStatus']; + id = json['id']; + username = json['username']; + firstName = json['firstName']; + lastName = json['lastName']; + email = json['email']; + password = json['password']; + phone = json['phone']; + userStatus = json['userStatus']; } Map toJson() { @@ -62,15 +46,11 @@ class User { 'password': password, 'phone': phone, 'userStatus': userStatus - }; + }; } - static List listFromJson(List> json) { - var list = new List(); - if (json != null && json.length > 0) { - json.forEach((Map value) => list.add(new User.fromJson(value))); - } - return list; + static List listFromJson(List json) { + return json == null ? new List() : json.map((value) => new User.fromJson(value)).toList(); } static Map mapFromJson(Map> json) { diff --git a/samples/client/petstore/dart/swagger/pubspec.yaml b/samples/client/petstore/dart/openapi/pubspec.yaml similarity index 54% rename from samples/client/petstore/dart/swagger/pubspec.yaml rename to samples/client/petstore/dart/openapi/pubspec.yaml index 1f94390bbb7..d54efb46a2e 100644 --- a/samples/client/petstore/dart/swagger/pubspec.yaml +++ b/samples/client/petstore/dart/openapi/pubspec.yaml @@ -1,5 +1,5 @@ -name: swagger +name: openapi version: 1.0.0 -description: Swagger API client +description: OpenAPI API client dependencies: http: '>=0.11.1 <0.12.0' diff --git a/samples/client/petstore/dart/petstore/pubspec.yaml b/samples/client/petstore/dart/petstore/pubspec.yaml index 108bc8a9305..373c848db59 100644 --- a/samples/client/petstore/dart/petstore/pubspec.yaml +++ b/samples/client/petstore/dart/petstore/pubspec.yaml @@ -1,9 +1,9 @@ name: petstore_client version: 1.0.0 -description: Petstore client using swagger API library +description: Petstore client using OpenAPI library dependencies: - swagger: - path: ../swagger-browser-client + openapi: + path: ../openapi-browser-client browser: any dev_dependencies: guinness: '^0.1.17' diff --git a/samples/client/petstore/dart/petstore/test/tests.dart b/samples/client/petstore/dart/petstore/test/tests.dart index 9511ea17875..cea11e15a9c 100644 --- a/samples/client/petstore/dart/petstore/test/tests.dart +++ b/samples/client/petstore/dart/petstore/test/tests.dart @@ -4,7 +4,7 @@ import 'dart:async'; import 'dart:math'; import 'package:http/http.dart'; import 'package:guinness/guinness.dart'; -import 'package:swagger/api.dart'; +import 'package:openapi/api.dart'; part 'pet_test.dart'; part 'store_test.dart'; diff --git a/samples/client/petstore/dart/swagger/.openapi-generator/VERSION b/samples/client/petstore/dart/swagger/.openapi-generator/VERSION deleted file mode 100644 index 855ff9501eb..00000000000 --- a/samples/client/petstore/dart/swagger/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.4.0-SNAPSHOT \ No newline at end of file