diff --git a/.gitignore b/.gitignore index 942cbf756889..7c0b4fe1100b 100644 --- a/.gitignore +++ b/.gitignore @@ -218,6 +218,7 @@ samples/server/petstore/erlang-server/rebar.lock samples/client/petstore/dart/petstore/packages samples/client/petstore/dart/flutter_petstore/test/packages samples/client/petstore/dart/petstore/test/packages +**/.dart_tool # JS samples/client/petstore/javascript/package-lock.json 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 12f91133f0db..c16815b18638 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 @@ -49,6 +49,8 @@ public class DartClientCodegen extends DefaultCodegen implements CodegenConfig { protected String sourceFolder = ""; protected String apiDocPath = "docs" + File.separator; protected String modelDocPath = "docs" + File.separator; + protected String apiTestPath = "test" + File.separator; + protected String modelTestPath = "test" + File.separator; public DartClientCodegen() { super(); @@ -66,6 +68,9 @@ public DartClientCodegen() { modelDocTemplateFiles.put("object_doc.mustache", ".md"); apiDocTemplateFiles.put("api_doc.mustache", ".md"); + modelTestTemplateFiles.put("model_test.mustache", ".dart"); + apiTestTemplateFiles.put("api_test.mustache", ".dart"); + setReservedWordsLowerCase( Arrays.asList( "abstract", "as", "assert", "async", "async*", "await", @@ -214,6 +219,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml")); } @Override @@ -231,6 +237,16 @@ public String modelFileFolder() { return outputFolder + File.separator + sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar); } + @Override + public String apiTestFileFolder() { + return outputFolder + File.separator + apiTestPath.replace('/', File.separatorChar); + } + + @Override + public String modelTestFileFolder() { + return outputFolder + File.separator + modelTestPath.replace('/', File.separatorChar); + } + @Override public String apiDocFileFolder() { return outputFolder + File.separator + apiDocPath.replace('/', File.separatorChar); @@ -295,6 +311,16 @@ public String toApiFilename(String name) { return underscore(toApiName(name)); } + @Override + public String toApiTestFilename(String name) { + return toApiFilename(name) + "_test"; + } + + @Override + public String toModelTestFilename(String name) { + return toModelFilename(name) + "_test"; + } + @Override public String toDefaultValue(Schema schema) { if (ModelUtils.isMapSchema(schema)) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java index 6e2507b7a4d1..7ba6d4284a92 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartJaguarClientCodegen.java @@ -177,6 +177,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh")); supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml")); final String authFolder = sourceFolder + File.separator + "lib" + File.separator + "auth"; supportingFiles.add(new SupportingFile("auth/api_key_auth.mustache", authFolder, "api_key_auth.dart")); diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/api_test.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/api_test.mustache new file mode 100644 index 000000000000..951aaf86d85c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/api_test.mustache @@ -0,0 +1,28 @@ +import 'package:{{pubName}}/api.dart'; +import 'package:test/test.dart'; + +{{#operations}} + +/// tests for {{classname}} +void main() { + var instance = new {{classname}}(); + + group('tests for {{classname}}', () { + {{#operation}} + {{#summary}} + // {{{.}}} + // + {{/summary}} + {{#notes}} + // {{{.}}} + // + {{/notes}} + //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{operationId}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + test('test {{operationId}}', () async { + // TODO + }); + + {{/operation}} + }); +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/model_test.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/model_test.mustache new file mode 100644 index 000000000000..89300fed75d5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/model_test.mustache @@ -0,0 +1,26 @@ +{{#models}} +{{#model}} +import 'package:{{pubName}}/api.dart'; +import 'package:test/test.dart'; + +// tests for {{classname}} +void main() { + var instance = new Pet(); + + group('test {{classname}}', () { + {{#vars}} + {{#description}} + // {{{description}}} + {{/description}} + // {{{dataType}}} {{name}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} + test('to test the property `{{name}}`', () async { + // TODO + }); + + {{/vars}} + + }); + +} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/travis.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/travis.mustache new file mode 100644 index 000000000000..82b19541fa43 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/travis.mustache @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "1.24.3" +install: +- pub get + +script: +- pub run test diff --git a/modules/openapi-generator/src/main/resources/dart/api_test.mustache b/modules/openapi-generator/src/main/resources/dart/api_test.mustache new file mode 100644 index 000000000000..951aaf86d85c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/api_test.mustache @@ -0,0 +1,28 @@ +import 'package:{{pubName}}/api.dart'; +import 'package:test/test.dart'; + +{{#operations}} + +/// tests for {{classname}} +void main() { + var instance = new {{classname}}(); + + group('tests for {{classname}}', () { + {{#operation}} + {{#summary}} + // {{{.}}} + // + {{/summary}} + {{#notes}} + // {{{.}}} + // + {{/notes}} + //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{operationId}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + test('test {{operationId}}', () async { + // TODO + }); + + {{/operation}} + }); +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart/model_test.mustache b/modules/openapi-generator/src/main/resources/dart/model_test.mustache new file mode 100644 index 000000000000..89300fed75d5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/model_test.mustache @@ -0,0 +1,26 @@ +{{#models}} +{{#model}} +import 'package:{{pubName}}/api.dart'; +import 'package:test/test.dart'; + +// tests for {{classname}} +void main() { + var instance = new Pet(); + + group('test {{classname}}', () { + {{#vars}} + {{#description}} + // {{{description}}} + {{/description}} + // {{{dataType}}} {{name}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} + test('to test the property `{{name}}`', () async { + // TODO + }); + + {{/vars}} + + }); + +} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart/pubspec.mustache index ef8fab4bb2a5..997448a9bebe 100644 --- a/modules/openapi-generator/src/main/resources/dart/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart/pubspec.mustache @@ -3,3 +3,5 @@ version: {{pubVersion}} description: {{pubDescription}} dependencies: http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/modules/openapi-generator/src/main/resources/dart/travis.mustache b/modules/openapi-generator/src/main/resources/dart/travis.mustache new file mode 100644 index 000000000000..82b19541fa43 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart/travis.mustache @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "1.24.3" +install: +- pub get + +script: +- pub run test diff --git a/modules/openapi-generator/src/main/resources/dart2/api_test.mustache b/modules/openapi-generator/src/main/resources/dart2/api_test.mustache new file mode 100644 index 000000000000..951aaf86d85c --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart2/api_test.mustache @@ -0,0 +1,28 @@ +import 'package:{{pubName}}/api.dart'; +import 'package:test/test.dart'; + +{{#operations}} + +/// tests for {{classname}} +void main() { + var instance = new {{classname}}(); + + group('tests for {{classname}}', () { + {{#operation}} + {{#summary}} + // {{{.}}} + // + {{/summary}} + {{#notes}} + // {{{.}}} + // + {{/notes}} + //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{operationId}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + test('test {{operationId}}', () async { + // TODO + }); + + {{/operation}} + }); +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/dart2/model_test.mustache b/modules/openapi-generator/src/main/resources/dart2/model_test.mustache new file mode 100644 index 000000000000..89300fed75d5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart2/model_test.mustache @@ -0,0 +1,26 @@ +{{#models}} +{{#model}} +import 'package:{{pubName}}/api.dart'; +import 'package:test/test.dart'; + +// tests for {{classname}} +void main() { + var instance = new Pet(); + + group('test {{classname}}', () { + {{#vars}} + {{#description}} + // {{{description}}} + {{/description}} + // {{{dataType}}} {{name}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} + test('to test the property `{{name}}`', () async { + // TODO + }); + + {{/vars}} + + }); + +} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache index 008cee0b2412..43bb64bb55e1 100644 --- a/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/pubspec.mustache @@ -5,3 +5,5 @@ environment: sdk: '>=2.0.0 <3.0.0' dependencies: http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/modules/openapi-generator/src/main/resources/dart2/travis.mustache b/modules/openapi-generator/src/main/resources/dart2/travis.mustache new file mode 100644 index 000000000000..d0758bc9f0d6 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/dart2/travis.mustache @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "2.2.0" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/VERSION index afa636560641..06b5019af3f4 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.travis.yml b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.travis.yml new file mode 100644 index 000000000000..82b19541fa43 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "1.24.3" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md index 4d6a82999886..625afaf4ce7a 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/README.md @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api ke This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: - API version: 1.0.0 -- Build date: 2019-03-01T12:01:27.554664+01:00[Europe/Paris] +- Build date: 2019-05-27T15:39:26.158+08:00[Asia/Hong_Kong] - Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen ## Requirements diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/api_response_test.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/api_response_test.dart new file mode 100644 index 000000000000..ebf142904e9f --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/category_test.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/category_test.dart new file mode 100644 index 000000000000..c5cea4b5bc3b --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/order_test.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/order_test.dart new file mode 100644 index 000000000000..9982020d8cf7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/pet_api_test.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/pet_api_test.dart new file mode 100644 index 000000000000..fa95dccad3cd --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/pet_test.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/pet_test.dart new file mode 100644 index 000000000000..38e74f087f6f --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: const []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: const []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/store_api_test.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/store_api_test.dart new file mode 100644 index 000000000000..496d051e8334 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/tag_test.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/tag_test.dart new file mode 100644 index 000000000000..6ee16c51bbac --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/user_api_test.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/user_api_test.dart new file mode 100644 index 000000000000..f040b01bf435 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/user_test.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/user_test.dart new file mode 100644 index 000000000000..5a6340c4f4b7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/openapi/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/VERSION index afa636560641..06b5019af3f4 100644 --- a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.travis.yml b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.travis.yml new file mode 100644 index 000000000000..82b19541fa43 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "1.24.3" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md index 754298dd4283..19c7f232ec1c 100644 --- a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/README.md @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api ke This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: - API version: 1.0.0 -- Build date: 2019-03-01T12:01:29.772495+01:00[Europe/Paris] +- Build date: 2019-05-27T15:39:27.745+08:00[Asia/Hong_Kong] - Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen ## Requirements diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/api_response_test.dart b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/api_response_test.dart new file mode 100644 index 000000000000..ebf142904e9f --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/category_test.dart b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/category_test.dart new file mode 100644 index 000000000000..c5cea4b5bc3b --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/order_test.dart b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/order_test.dart new file mode 100644 index 000000000000..9982020d8cf7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/pet_api_test.dart b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/pet_api_test.dart new file mode 100644 index 000000000000..fa95dccad3cd --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/pet_test.dart b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/pet_test.dart new file mode 100644 index 000000000000..38e74f087f6f --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: const []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: const []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/store_api_test.dart b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/store_api_test.dart new file mode 100644 index 000000000000..496d051e8334 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/tag_test.dart b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/tag_test.dart new file mode 100644 index 000000000000..6ee16c51bbac --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/user_api_test.dart b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/user_api_test.dart new file mode 100644 index 000000000000..f040b01bf435 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/user_test.dart b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/user_test.dart new file mode 100644 index 000000000000..5a6340c4f4b7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/flutter_proto_petstore/openapi/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION index afa636560641..06b5019af3f4 100644 --- a/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-jaguar/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/openapi/.travis.yml b/samples/client/petstore/dart-jaguar/openapi/.travis.yml new file mode 100644 index 000000000000..82b19541fa43 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "1.24.3" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart-jaguar/openapi/README.md b/samples/client/petstore/dart-jaguar/openapi/README.md index c1aaa00be522..ab1e76188f50 100644 --- a/samples/client/petstore/dart-jaguar/openapi/README.md +++ b/samples/client/petstore/dart-jaguar/openapi/README.md @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api ke This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: - API version: 1.0.0 -- Build date: 2019-03-01T12:01:24.840508+01:00[Europe/Paris] +- Build date: 2019-05-27T15:39:24.552+08:00[Asia/Hong_Kong] - Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen ## Requirements diff --git a/samples/client/petstore/dart-jaguar/openapi/test/api_response_test.dart b/samples/client/petstore/dart-jaguar/openapi/test/api_response_test.dart new file mode 100644 index 000000000000..ebf142904e9f --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/openapi/test/category_test.dart b/samples/client/petstore/dart-jaguar/openapi/test/category_test.dart new file mode 100644 index 000000000000..c5cea4b5bc3b --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/openapi/test/order_test.dart b/samples/client/petstore/dart-jaguar/openapi/test/order_test.dart new file mode 100644 index 000000000000..9982020d8cf7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/openapi/test/pet_api_test.dart b/samples/client/petstore/dart-jaguar/openapi/test/pet_api_test.dart new file mode 100644 index 000000000000..fa95dccad3cd --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart-jaguar/openapi/test/pet_test.dart b/samples/client/petstore/dart-jaguar/openapi/test/pet_test.dart new file mode 100644 index 000000000000..38e74f087f6f --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: const []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: const []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/openapi/test/store_api_test.dart b/samples/client/petstore/dart-jaguar/openapi/test/store_api_test.dart new file mode 100644 index 000000000000..496d051e8334 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart-jaguar/openapi/test/tag_test.dart b/samples/client/petstore/dart-jaguar/openapi/test/tag_test.dart new file mode 100644 index 000000000000..6ee16c51bbac --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/openapi/test/user_api_test.dart b/samples/client/petstore/dart-jaguar/openapi/test/user_api_test.dart new file mode 100644 index 000000000000..f040b01bf435 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart-jaguar/openapi/test/user_test.dart b/samples/client/petstore/dart-jaguar/openapi/test/user_test.dart new file mode 100644 index 000000000000..5a6340c4f4b7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/VERSION b/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/VERSION index afa636560641..06b5019af3f4 100644 --- a/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/VERSION +++ b/samples/client/petstore/dart-jaguar/openapi_proto/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/.travis.yml b/samples/client/petstore/dart-jaguar/openapi_proto/.travis.yml new file mode 100644 index 000000000000..82b19541fa43 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "1.24.3" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/README.md b/samples/client/petstore/dart-jaguar/openapi_proto/README.md index ce0ec5d2324c..1ab7a37f12bd 100644 --- a/samples/client/petstore/dart-jaguar/openapi_proto/README.md +++ b/samples/client/petstore/dart-jaguar/openapi_proto/README.md @@ -4,7 +4,7 @@ This is a sample server Petstore server. For this sample, you can use the api ke This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: - API version: 1.0.0 -- Build date: 2019-03-01T12:01:34.442031+01:00[Europe/Paris] +- Build date: 2019-05-27T15:39:29.348+08:00[Asia/Hong_Kong] - Build package: org.openapitools.codegen.languages.DartJaguarClientCodegen ## Requirements diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/test/api_response_test.dart b/samples/client/petstore/dart-jaguar/openapi_proto/test/api_response_test.dart new file mode 100644 index 000000000000..ebf142904e9f --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/test/category_test.dart b/samples/client/petstore/dart-jaguar/openapi_proto/test/category_test.dart new file mode 100644 index 000000000000..c5cea4b5bc3b --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/test/order_test.dart b/samples/client/petstore/dart-jaguar/openapi_proto/test/order_test.dart new file mode 100644 index 000000000000..9982020d8cf7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/test/pet_api_test.dart b/samples/client/petstore/dart-jaguar/openapi_proto/test/pet_api_test.dart new file mode 100644 index 000000000000..fa95dccad3cd --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/test/pet_test.dart b/samples/client/petstore/dart-jaguar/openapi_proto/test/pet_test.dart new file mode 100644 index 000000000000..38e74f087f6f --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: const []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: const []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/test/store_api_test.dart b/samples/client/petstore/dart-jaguar/openapi_proto/test/store_api_test.dart new file mode 100644 index 000000000000..496d051e8334 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/test/tag_test.dart b/samples/client/petstore/dart-jaguar/openapi_proto/test/tag_test.dart new file mode 100644 index 000000000000..6ee16c51bbac --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/test/user_api_test.dart b/samples/client/petstore/dart-jaguar/openapi_proto/test/user_api_test.dart new file mode 100644 index 000000000000..f040b01bf435 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart-jaguar/openapi_proto/test/user_test.dart b/samples/client/petstore/dart-jaguar/openapi_proto/test/user_test.dart new file mode 100644 index 000000000000..5a6340c4f4b7 --- /dev/null +++ b/samples/client/petstore/dart-jaguar/openapi_proto/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION index afa636560641..06b5019af3f4 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml new file mode 100644 index 000000000000..82b19541fa43 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "1.24.3" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml index 79e5223fcd03..b63f835e89b3 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml @@ -3,3 +3,5 @@ version: 1.0.0 description: OpenAPI API client dependencies: http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/api_response_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/api_response_test.dart new file mode 100644 index 000000000000..ebf142904e9f --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/category_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/category_test.dart new file mode 100644 index 000000000000..c5cea4b5bc3b --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/order_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/order_test.dart new file mode 100644 index 000000000000..9982020d8cf7 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_api_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_api_test.dart new file mode 100644 index 000000000000..fa95dccad3cd --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_test.dart new file mode 100644 index 000000000000..cfd94b9e36c3 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/store_api_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/store_api_test.dart new file mode 100644 index 000000000000..496d051e8334 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/tag_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/tag_test.dart new file mode 100644 index 000000000000..6ee16c51bbac --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/user_api_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/user_api_test.dart new file mode 100644 index 000000000000..f040b01bf435 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/test/user_test.dart b/samples/client/petstore/dart/flutter_petstore/openapi/test/user_test.dart new file mode 100644 index 000000000000..5a6340c4f4b7 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/openapi/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION b/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION index afa636560641..06b5019af3f4 100644 --- a/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/openapi-browser-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/openapi-browser-client/.travis.yml b/samples/client/petstore/dart/openapi-browser-client/.travis.yml new file mode 100644 index 000000000000..82b19541fa43 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "1.24.3" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml b/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml index 79e5223fcd03..b63f835e89b3 100644 --- a/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml +++ b/samples/client/petstore/dart/openapi-browser-client/pubspec.yaml @@ -3,3 +3,5 @@ version: 1.0.0 description: OpenAPI API client dependencies: http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart/openapi-browser-client/test/api_response_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/api_response_test.dart new file mode 100644 index 000000000000..ebf142904e9f --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/category_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/category_test.dart new file mode 100644 index 000000000000..c5cea4b5bc3b --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/order_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/order_test.dart new file mode 100644 index 000000000000..9982020d8cf7 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/pet_api_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/pet_api_test.dart new file mode 100644 index 000000000000..fa95dccad3cd --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/pet_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/pet_test.dart new file mode 100644 index 000000000000..cfd94b9e36c3 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/store_api_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/store_api_test.dart new file mode 100644 index 000000000000..496d051e8334 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/tag_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/tag_test.dart new file mode 100644 index 000000000000..6ee16c51bbac --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/user_api_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/user_api_test.dart new file mode 100644 index 000000000000..f040b01bf435 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/openapi-browser-client/test/user_test.dart b/samples/client/petstore/dart/openapi-browser-client/test/user_test.dart new file mode 100644 index 000000000000..5a6340c4f4b7 --- /dev/null +++ b/samples/client/petstore/dart/openapi-browser-client/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION index afa636560641..06b5019af3f4 100644 --- a/samples/client/petstore/dart/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/openapi/.travis.yml b/samples/client/petstore/dart/openapi/.travis.yml new file mode 100644 index 000000000000..82b19541fa43 --- /dev/null +++ b/samples/client/petstore/dart/openapi/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "1.24.3" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart/openapi/pubspec.yaml b/samples/client/petstore/dart/openapi/pubspec.yaml index 79e5223fcd03..b63f835e89b3 100644 --- a/samples/client/petstore/dart/openapi/pubspec.yaml +++ b/samples/client/petstore/dart/openapi/pubspec.yaml @@ -3,3 +3,5 @@ version: 1.0.0 description: OpenAPI API client dependencies: http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart/openapi/test/api_response_test.dart b/samples/client/petstore/dart/openapi/test/api_response_test.dart new file mode 100644 index 000000000000..ebf142904e9f --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi/test/category_test.dart b/samples/client/petstore/dart/openapi/test/category_test.dart new file mode 100644 index 000000000000..c5cea4b5bc3b --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi/test/order_test.dart b/samples/client/petstore/dart/openapi/test/order_test.dart new file mode 100644 index 000000000000..9982020d8cf7 --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi/test/pet_api_test.dart b/samples/client/petstore/dart/openapi/test/pet_api_test.dart new file mode 100644 index 000000000000..fa95dccad3cd --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/openapi/test/pet_test.dart b/samples/client/petstore/dart/openapi/test/pet_test.dart new file mode 100644 index 000000000000..cfd94b9e36c3 --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi/test/store_api_test.dart b/samples/client/petstore/dart/openapi/test/store_api_test.dart new file mode 100644 index 000000000000..496d051e8334 --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/openapi/test/tag_test.dart b/samples/client/petstore/dart/openapi/test/tag_test.dart new file mode 100644 index 000000000000..6ee16c51bbac --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/openapi/test/user_api_test.dart b/samples/client/petstore/dart/openapi/test/user_api_test.dart new file mode 100644 index 000000000000..f040b01bf435 --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart/openapi/test/user_test.dart b/samples/client/petstore/dart/openapi/test/user_test.dart new file mode 100644 index 000000000000..5a6340c4f4b7 --- /dev/null +++ b/samples/client/petstore/dart/openapi/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart/purge_test.sh b/samples/client/petstore/dart/purge_test.sh new file mode 100755 index 000000000000..b11cf3564d04 --- /dev/null +++ b/samples/client/petstore/dart/purge_test.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "purge test fils under 'test' folder" +rm -Rf flutter_petstore/openapi/test/ +rm -Rf openapi/test/ +rm -Rf openapi-browser-client/test diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION index afa636560641..06b5019af3f4 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/.travis.yml b/samples/client/petstore/dart2/flutter_petstore/openapi/.travis.yml new file mode 100644 index 000000000000..d0758bc9f0d6 --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "2.2.0" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/pubspec.yaml b/samples/client/petstore/dart2/flutter_petstore/openapi/pubspec.yaml index 9ccf0e524ad0..391fa5edec02 100644 --- a/samples/client/petstore/dart2/flutter_petstore/openapi/pubspec.yaml +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/pubspec.yaml @@ -4,4 +4,6 @@ description: OpenAPI API client environment: sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.11.1 <0.12.0' + http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/api_response_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/api_response_test.dart new file mode 100644 index 000000000000..ebf142904e9f --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/category_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/category_test.dart new file mode 100644 index 000000000000..c5cea4b5bc3b --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/order_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/order_test.dart new file mode 100644 index 000000000000..9982020d8cf7 --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_api_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_api_test.dart new file mode 100644 index 000000000000..fa95dccad3cd --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_test.dart new file mode 100644 index 000000000000..cfd94b9e36c3 --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/store_api_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/store_api_test.dart new file mode 100644 index 000000000000..496d051e8334 --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/tag_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/tag_test.dart new file mode 100644 index 000000000000..6ee16c51bbac --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_api_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_api_test.dart new file mode 100644 index 000000000000..f040b01bf435 --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_test.dart b/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_test.dart new file mode 100644 index 000000000000..5a6340c4f4b7 --- /dev/null +++ b/samples/client/petstore/dart2/flutter_petstore/openapi/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION b/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION index afa636560641..06b5019af3f4 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/openapi-browser-client/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/openapi-browser-client/.travis.yml b/samples/client/petstore/dart2/openapi-browser-client/.travis.yml new file mode 100644 index 000000000000..d0758bc9f0d6 --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "2.2.0" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart2/openapi-browser-client/pubspec.yaml b/samples/client/petstore/dart2/openapi-browser-client/pubspec.yaml index 9ccf0e524ad0..391fa5edec02 100644 --- a/samples/client/petstore/dart2/openapi-browser-client/pubspec.yaml +++ b/samples/client/petstore/dart2/openapi-browser-client/pubspec.yaml @@ -4,4 +4,6 @@ description: OpenAPI API client environment: sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.11.1 <0.12.0' + http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/api_response_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/api_response_test.dart new file mode 100644 index 000000000000..ebf142904e9f --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/category_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/category_test.dart new file mode 100644 index 000000000000..c5cea4b5bc3b --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/order_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/order_test.dart new file mode 100644 index 000000000000..9982020d8cf7 --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/pet_api_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/pet_api_test.dart new file mode 100644 index 000000000000..fa95dccad3cd --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/pet_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/pet_test.dart new file mode 100644 index 000000000000..cfd94b9e36c3 --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/store_api_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/store_api_test.dart new file mode 100644 index 000000000000..496d051e8334 --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/tag_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/tag_test.dart new file mode 100644 index 000000000000..6ee16c51bbac --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/user_api_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/user_api_test.dart new file mode 100644 index 000000000000..f040b01bf435 --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/openapi-browser-client/test/user_test.dart b/samples/client/petstore/dart2/openapi-browser-client/test/user_test.dart new file mode 100644 index 000000000000..5a6340c4f4b7 --- /dev/null +++ b/samples/client/petstore/dart2/openapi-browser-client/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION index afa636560641..06b5019af3f4 100644 --- a/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart2/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart2/openapi/.travis.yml b/samples/client/petstore/dart2/openapi/.travis.yml new file mode 100644 index 000000000000..d0758bc9f0d6 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/.travis.yml @@ -0,0 +1,11 @@ +# https://docs.travis-ci.com/user/languages/dart/ +# +language: dart +dart: +# Install a specific stable release +- "2.2.0" +install: +- pub get + +script: +- pub run test diff --git a/samples/client/petstore/dart2/openapi/pubspec.yaml b/samples/client/petstore/dart2/openapi/pubspec.yaml index 9ccf0e524ad0..391fa5edec02 100644 --- a/samples/client/petstore/dart2/openapi/pubspec.yaml +++ b/samples/client/petstore/dart2/openapi/pubspec.yaml @@ -4,4 +4,6 @@ description: OpenAPI API client environment: sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.11.1 <0.12.0' + http: '>=0.11.1 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart2/openapi/test/api_response_test.dart b/samples/client/petstore/dart2/openapi/test/api_response_test.dart new file mode 100644 index 000000000000..ebf142904e9f --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/api_response_test.dart @@ -0,0 +1,27 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for ApiResponse +void main() { + var instance = new Pet(); + + group('test ApiResponse', () { + // int code (default value: null) + test('to test the property `code`', () async { + // TODO + }); + + // String type (default value: null) + test('to test the property `type`', () async { + // TODO + }); + + // String message (default value: null) + test('to test the property `message`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi/test/category_test.dart b/samples/client/petstore/dart2/openapi/test/category_test.dart new file mode 100644 index 000000000000..c5cea4b5bc3b --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/category_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Category +void main() { + var instance = new Pet(); + + group('test Category', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi/test/order_test.dart b/samples/client/petstore/dart2/openapi/test/order_test.dart new file mode 100644 index 000000000000..9982020d8cf7 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/order_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Order +void main() { + var instance = new Pet(); + + group('test Order', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // int petId (default value: null) + test('to test the property `petId`', () async { + // TODO + }); + + // int quantity (default value: null) + test('to test the property `quantity`', () async { + // TODO + }); + + // DateTime shipDate (default value: null) + test('to test the property `shipDate`', () async { + // TODO + }); + + // Order Status + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + // bool complete (default value: false) + test('to test the property `complete`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi/test/pet_api_test.dart b/samples/client/petstore/dart2/openapi/test/pet_api_test.dart new file mode 100644 index 000000000000..fa95dccad3cd --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/pet_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for PetApi +void main() { + var instance = new PetApi(); + + group('tests for PetApi', () { + // Add a new pet to the store + // + //Future addPet(Pet body) async + test('test addPet', () async { + // TODO + }); + + // Deletes a pet + // + //Future deletePet(int petId, { String apiKey }) async + test('test deletePet', () async { + // TODO + }); + + // Finds Pets by status + // + // Multiple status values can be provided with comma separated strings + // + //Future> findPetsByStatus(List status) async + test('test findPetsByStatus', () async { + // TODO + }); + + // Finds Pets by tags + // + // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + // + //Future> findPetsByTags(List tags) async + test('test findPetsByTags', () async { + // TODO + }); + + // Find pet by ID + // + // Returns a single pet + // + //Future getPetById(int petId) async + test('test getPetById', () async { + // TODO + }); + + // Update an existing pet + // + //Future updatePet(Pet body) async + test('test updatePet', () async { + // TODO + }); + + // Updates a pet in the store with form data + // + //Future updatePetWithForm(int petId, { String name, String status }) async + test('test updatePetWithForm', () async { + // TODO + }); + + // uploads an image + // + //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async + test('test uploadFile', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/openapi/test/pet_test.dart b/samples/client/petstore/dart2/openapi/test/pet_test.dart new file mode 100644 index 000000000000..cfd94b9e36c3 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/pet_test.dart @@ -0,0 +1,43 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Pet +void main() { + var instance = new Pet(); + + group('test Pet', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // Category category (default value: null) + test('to test the property `category`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + // List photoUrls (default value: []) + test('to test the property `photoUrls`', () async { + // TODO + }); + + // List tags (default value: []) + test('to test the property `tags`', () async { + // TODO + }); + + // pet status in the store + // String status (default value: null) + test('to test the property `status`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi/test/store_api_test.dart b/samples/client/petstore/dart2/openapi/test/store_api_test.dart new file mode 100644 index 000000000000..496d051e8334 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/store_api_test.dart @@ -0,0 +1,45 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for StoreApi +void main() { + var instance = new StoreApi(); + + group('tests for StoreApi', () { + // Delete purchase order by ID + // + // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + // + //Future deleteOrder(String orderId) async + test('test deleteOrder', () async { + // TODO + }); + + // Returns pet inventories by status + // + // Returns a map of status codes to quantities + // + //Future> getInventory() async + test('test getInventory', () async { + // TODO + }); + + // Find purchase order by ID + // + // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + // + //Future getOrderById(int orderId) async + test('test getOrderById', () async { + // TODO + }); + + // Place an order for a pet + // + //Future placeOrder(Order body) async + test('test placeOrder', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/openapi/test/tag_test.dart b/samples/client/petstore/dart2/openapi/test/tag_test.dart new file mode 100644 index 000000000000..6ee16c51bbac --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/tag_test.dart @@ -0,0 +1,22 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for Tag +void main() { + var instance = new Pet(); + + group('test Tag', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String name (default value: null) + test('to test the property `name`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/openapi/test/user_api_test.dart b/samples/client/petstore/dart2/openapi/test/user_api_test.dart new file mode 100644 index 000000000000..f040b01bf435 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/user_api_test.dart @@ -0,0 +1,73 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + + +/// tests for UserApi +void main() { + var instance = new UserApi(); + + group('tests for UserApi', () { + // Create user + // + // This can only be done by the logged in user. + // + //Future createUser(User body) async + test('test createUser', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithArrayInput(List body) async + test('test createUsersWithArrayInput', () async { + // TODO + }); + + // Creates list of users with given input array + // + //Future createUsersWithListInput(List body) async + test('test createUsersWithListInput', () async { + // TODO + }); + + // Delete user + // + // This can only be done by the logged in user. + // + //Future deleteUser(String username) async + test('test deleteUser', () async { + // TODO + }); + + // Get user by user name + // + //Future getUserByName(String username) async + test('test getUserByName', () async { + // TODO + }); + + // Logs user into the system + // + //Future loginUser(String username, String password) async + test('test loginUser', () async { + // TODO + }); + + // Logs out current logged in user session + // + //Future logoutUser() async + test('test logoutUser', () async { + // TODO + }); + + // Updated user + // + // This can only be done by the logged in user. + // + //Future updateUser(String username, User body) async + test('test updateUser', () async { + // TODO + }); + + }); +} diff --git a/samples/client/petstore/dart2/openapi/test/user_test.dart b/samples/client/petstore/dart2/openapi/test/user_test.dart new file mode 100644 index 000000000000..5a6340c4f4b7 --- /dev/null +++ b/samples/client/petstore/dart2/openapi/test/user_test.dart @@ -0,0 +1,53 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +// tests for User +void main() { + var instance = new Pet(); + + group('test User', () { + // int id (default value: null) + test('to test the property `id`', () async { + // TODO + }); + + // String username (default value: null) + test('to test the property `username`', () async { + // TODO + }); + + // String firstName (default value: null) + test('to test the property `firstName`', () async { + // TODO + }); + + // String lastName (default value: null) + test('to test the property `lastName`', () async { + // TODO + }); + + // String email (default value: null) + test('to test the property `email`', () async { + // TODO + }); + + // String password (default value: null) + test('to test the property `password`', () async { + // TODO + }); + + // String phone (default value: null) + test('to test the property `phone`', () async { + // TODO + }); + + // User Status + // int userStatus (default value: null) + test('to test the property `userStatus`', () async { + // TODO + }); + + + }); + +} diff --git a/samples/client/petstore/dart2/purge_test.sh b/samples/client/petstore/dart2/purge_test.sh new file mode 100755 index 000000000000..b11cf3564d04 --- /dev/null +++ b/samples/client/petstore/dart2/purge_test.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "purge test fils under 'test' folder" +rm -Rf flutter_petstore/openapi/test/ +rm -Rf openapi/test/ +rm -Rf openapi-browser-client/test