diff --git a/CI/.drone.yml b/CI/.drone.yml index 5480eb2a9a..d7ba47e941 100644 --- a/CI/.drone.yml +++ b/CI/.drone.yml @@ -2,6 +2,13 @@ kind: pipeline name: default steps: +# test Dart 2.x petstore client +- name: dart2x-test + image: google/dart + commands: + - (cd samples/client/petstore/dart-jaguar/openapi && pub get && pub run build_runner build --delete-conflicting-outputs) + - (cd samples/client/petstore/dart-jaguar/flutter_petstore/openapi && pub get && pub run build_runner build --delete-conflicting-outputs) + - (cd samples/client/petstore/dart2/openapi && pub get && pub run test) # test Java 11 HTTP client - name: java11-test image: hirokimatsumoto/alpine-openjdk-11 diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index 5eb7858509..a29346ad2c 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -59,6 +59,9 @@ declare -a scripts=( "./bin/apex-petstore.sh" "./bin/perl-petstore-all.sh" "./bin/dart-jaguar-petstore.sh" +"./bin/dart-flutter-petstore.sh" +"./bin/dart-petstore.sh" +"./bin/dart2-petstore.sh" #"./bin/elm-petstore-all.sh" "./bin/meta-codegen.sh" # OTHERS diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml index d0758bc9f0..82b19541fa 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/.travis.yml @@ -3,7 +3,7 @@ language: dart dart: # Install a specific stable release -- "2.2.0" +- "1.24.3" install: - pub get diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/README.md b/samples/client/petstore/dart/flutter_petstore/openapi/README.md index ae7f6ea5e8..8520a219f8 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/README.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/README.md @@ -44,13 +44,13 @@ Please follow the [installation procedure](#installation--usage) and then run th import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var pet = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(pet); + api_instance.addPet(body); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -89,8 +89,6 @@ Class | Method | HTTP request | Description - [ApiResponse](docs//ApiResponse.md) - [Category](docs//Category.md) - - [InlineObject](docs//InlineObject.md) - - [InlineObject1](docs//InlineObject1.md) - [Order](docs//Order.md) - [Pet](docs//Pet.md) - [Tag](docs//Tag.md) @@ -106,12 +104,6 @@ Class | Method | HTTP request | Description - **API key parameter name**: api_key - **Location**: HTTP header -## auth_cookie - -- **Type**: API key -- **API key parameter name**: AUTH_KEY -- **Location**: - ## petstore_auth - **Type**: OAuth diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md index 9a336433b9..5780e7f380 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/PetApi.md @@ -20,7 +20,7 @@ Method | HTTP request | Description # **addPet** -> addPet(pet) +> addPet(body) Add a new pet to the store @@ -28,13 +28,13 @@ Add a new pet to the store ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var pet = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.addPet(pet); + api_instance.addPet(body); } catch (e) { print("Exception when calling PetApi->addPet: $e\n"); } @@ -44,7 +44,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -70,9 +70,9 @@ Deletes a pet ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new PetApi(); var petId = 789; // int | Pet id to delete var apiKey = apiKey_example; // String | @@ -116,9 +116,9 @@ Multiple status values can be provided with comma separated strings ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new PetApi(); var status = []; // List | Status values that need to be considered for filter try { @@ -161,9 +161,9 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new PetApi(); var tags = []; // List | Tags to filter by try { @@ -206,11 +206,11 @@ Returns a single pet ```dart import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; -var api_instance = PetApi(); +var api_instance = new PetApi(); var petId = 789; // int | ID of pet to return try { @@ -243,7 +243,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **updatePet** -> updatePet(pet) +> updatePet(body) Update an existing pet @@ -251,13 +251,13 @@ Update an existing pet ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); -var pet = Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = new PetApi(); +var body = new Pet(); // Pet | Pet object that needs to be added to the store try { - api_instance.updatePet(pet); + api_instance.updatePet(body); } catch (e) { print("Exception when calling PetApi->updatePet: $e\n"); } @@ -267,7 +267,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -293,9 +293,9 @@ Updates a pet in the store with form data ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new PetApi(); var petId = 789; // int | ID of pet that needs to be updated var name = name_example; // String | Updated name of the pet var status = status_example; // String | Updated status of the pet @@ -339,9 +339,9 @@ uploads an image ```dart import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; +//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = PetApi(); +var api_instance = new PetApi(); var petId = 789; // int | ID of pet to update var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server var file = BINARY_DATA_HERE; // MultipartFile | file to upload diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md index 4a501766d3..df76647f11 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/StoreApi.md @@ -26,7 +26,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```dart import 'package:openapi/api.dart'; -var api_instance = StoreApi(); +var api_instance = new StoreApi(); var orderId = orderId_example; // String | ID of the order that needs to be deleted try { @@ -68,11 +68,11 @@ Returns a map of status codes to quantities ```dart import 'package:openapi/api.dart'; // TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; +//openapi.api.Configuration.apiKey{'api_key'} = 'YOUR_API_KEY'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; +//openapi.api.Configuration.apiKeyPrefix{'api_key'} = "Bearer"; -var api_instance = StoreApi(); +var api_instance = new StoreApi(); try { var result = api_instance.getInventory(); @@ -111,7 +111,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```dart import 'package:openapi/api.dart'; -var api_instance = StoreApi(); +var api_instance = new StoreApi(); var orderId = 789; // int | ID of pet that needs to be fetched try { @@ -144,7 +144,7 @@ No authorization required [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **placeOrder** -> Order placeOrder(order) +> Order placeOrder(body) Place an order for a pet @@ -152,11 +152,11 @@ Place an order for a pet ```dart import 'package:openapi/api.dart'; -var api_instance = StoreApi(); -var order = Order(); // Order | order placed for purchasing the pet +var api_instance = new StoreApi(); +var body = new Order(); // Order | order placed for purchasing the pet try { - var result = api_instance.placeOrder(order); + var result = api_instance.placeOrder(body); print(result); } catch (e) { print("Exception when calling StoreApi->placeOrder: $e\n"); @@ -167,7 +167,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -179,7 +179,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/xml, application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md b/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md index 4a9e433e25..d3bb61265e 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart/flutter_petstore/openapi/docs/UserApi.md @@ -20,7 +20,7 @@ Method | HTTP request | Description # **createUser** -> createUser(user) +> createUser(body) Create user @@ -29,16 +29,12 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; -// TODO Configure API key authorization: auth_cookie -//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = UserApi(); -var user = User(); // User | Created user object +var api_instance = new UserApi(); +var body = new User(); // User | Created user object try { - api_instance.createUser(user); + api_instance.createUser(body); } catch (e) { print("Exception when calling UserApi->createUser: $e\n"); } @@ -48,7 +44,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -56,33 +52,29 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **createUsersWithArrayInput** -> createUsersWithArrayInput(user) +> createUsersWithArrayInput(body) Creates list of users with given input array ### Example ```dart import 'package:openapi/api.dart'; -// TODO Configure API key authorization: auth_cookie -//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = UserApi(); -var user = [List<User>()]; // List | List of user object +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object try { - api_instance.createUsersWithArrayInput(user); + api_instance.createUsersWithArrayInput(body); } catch (e) { print("Exception when calling UserApi->createUsersWithArrayInput: $e\n"); } @@ -92,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](User.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -100,33 +92,29 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **createUsersWithListInput** -> createUsersWithListInput(user) +> createUsersWithListInput(body) Creates list of users with given input array ### Example ```dart import 'package:openapi/api.dart'; -// TODO Configure API key authorization: auth_cookie -//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = UserApi(); -var user = [List<User>()]; // List | List of user object +var api_instance = new UserApi(); +var body = [new List<User>()]; // List | List of user object try { - api_instance.createUsersWithListInput(user); + api_instance.createUsersWithListInput(body); } catch (e) { print("Exception when calling UserApi->createUsersWithListInput: $e\n"); } @@ -136,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](User.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -144,11 +132,11 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -163,12 +151,8 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; -// TODO Configure API key authorization: auth_cookie -//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = UserApi(); +var api_instance = new UserApi(); var username = username_example; // String | The name that needs to be deleted try { @@ -190,7 +174,7 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers @@ -208,7 +192,7 @@ Get user by user name ```dart import 'package:openapi/api.dart'; -var api_instance = UserApi(); +var api_instance = new UserApi(); var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. try { @@ -249,7 +233,7 @@ Logs user into the system ```dart import 'package:openapi/api.dart'; -var api_instance = UserApi(); +var api_instance = new UserApi(); var username = username_example; // String | The user name for login var password = password_example; // String | The password for login in clear text @@ -291,12 +275,8 @@ Logs out current logged in user session ### Example ```dart import 'package:openapi/api.dart'; -// TODO Configure API key authorization: auth_cookie -//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = UserApi(); +var api_instance = new UserApi(); try { api_instance.logoutUser(); @@ -314,7 +294,7 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers @@ -324,7 +304,7 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **updateUser** -> updateUser(username, user) +> updateUser(username, body) Updated user @@ -333,17 +313,13 @@ This can only be done by the logged in user. ### Example ```dart import 'package:openapi/api.dart'; -// TODO Configure API key authorization: auth_cookie -//defaultApiClient.getAuthentication('auth_cookie').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('auth_cookie').apiKeyPrefix = 'Bearer'; -var api_instance = UserApi(); +var api_instance = new UserApi(); var username = username_example; // String | name that need to be deleted -var user = User(); // User | Updated user object +var body = new User(); // User | Updated user object try { - api_instance.updateUser(username, user); + api_instance.updateUser(username, body); } catch (e) { print("Exception when calling UserApi->updateUser: $e\n"); } @@ -354,7 +330,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **user** | [**User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type @@ -362,11 +338,11 @@ void (empty response body) ### Authorization -[auth_cookie](../README.md#auth_cookie) +No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart index 675ff37a46..9a64a5342b 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api.dart @@ -18,12 +18,10 @@ part 'api/user_api.dart'; part 'model/api_response.dart'; part 'model/category.dart'; -part 'model/inline_object.dart'; -part 'model/inline_object1.dart'; part 'model/order.dart'; part 'model/pet.dart'; part 'model/tag.dart'; part 'model/user.dart'; -ApiClient defaultApiClient = ApiClient(); +ApiClient defaultApiClient = new ApiClient(); diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart index 13684301f7..6ffc146490 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/pet_api.dart @@ -10,12 +10,12 @@ class PetApi { /// Add a new pet to the store /// /// - Future addPet(Pet pet) async { - Object postBody = pet; + Future addPet(Pet body) async { + Object postBody = body; // verify required params are set - if(pet == null) { - throw ApiException(400, "Missing required param: pet"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -28,12 +28,12 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -60,11 +60,11 @@ class PetApi { /// /// Future deletePet(int petId, { String apiKey }) async { - Object postBody; + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -78,12 +78,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -100,7 +100,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -110,11 +110,11 @@ class PetApi { /// /// Multiple status values can be provided with comma separated strings Future> findPetsByStatus(List status) async { - Object postBody; + Object postBody = null; // verify required params are set if(status == null) { - throw ApiException(400, "Missing required param: status"); + throw new ApiException(400, "Missing required param: status"); } // create path and map variables @@ -128,12 +128,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -150,7 +150,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -161,11 +161,11 @@ class PetApi { /// /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. Future> findPetsByTags(List tags) async { - Object postBody; + Object postBody = null; // verify required params are set if(tags == null) { - throw ApiException(400, "Missing required param: tags"); + throw new ApiException(400, "Missing required param: tags"); } // create path and map variables @@ -179,12 +179,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -201,7 +201,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -212,11 +212,11 @@ class PetApi { /// /// Returns a single pet Future getPetById(int petId) async { - Object postBody; + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -229,12 +229,12 @@ class PetApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -251,7 +251,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Pet') as Pet; } else { @@ -261,12 +261,12 @@ class PetApi { /// Update an existing pet /// /// - Future updatePet(Pet pet) async { - Object postBody = pet; + Future updatePet(Pet body) async { + Object postBody = body; // verify required params are set - if(pet == null) { - throw ApiException(400, "Missing required param: pet"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -279,12 +279,12 @@ class PetApi { List contentTypes = ["application/json","application/xml"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -301,7 +301,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -311,11 +311,11 @@ class PetApi { /// /// Future updatePetWithForm(int petId, { String name, String status }) async { - Object postBody; + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -328,12 +328,12 @@ class PetApi { List contentTypes = ["application/x-www-form-urlencoded"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if (name != null) { hasFields = true; mp.fields['name'] = parameterToString(name); @@ -362,7 +362,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -372,11 +372,11 @@ class PetApi { /// /// Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async { - Object postBody; + Object postBody = null; // verify required params are set if(petId == null) { - throw ApiException(400, "Missing required param: petId"); + throw new ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -389,12 +389,12 @@ class PetApi { List contentTypes = ["multipart/form-data"]; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["petstore_auth"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if (additionalMetadata != null) { hasFields = true; mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); @@ -422,7 +422,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'ApiResponse') as ApiResponse; } else { diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart index f21b5ce98a..7475aa4d99 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/store_api.dart @@ -11,11 +11,11 @@ class StoreApi { /// /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors Future deleteOrder(String orderId) async { - Object postBody; + Object postBody = null; // verify required params are set if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); + throw new ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -28,12 +28,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -60,7 +60,7 @@ class StoreApi { /// /// Returns a map of status codes to quantities Future> getInventory() async { - Object postBody; + Object postBody = null; // verify required params are set @@ -74,12 +74,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = ["api_key"]; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -96,9 +96,9 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { - return Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); + return new Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); ; } else { return null; @@ -108,11 +108,11 @@ class StoreApi { /// /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions Future getOrderById(int orderId) async { - Object postBody; + Object postBody = null; // verify required params are set if(orderId == null) { - throw ApiException(400, "Missing required param: orderId"); + throw new ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -125,12 +125,12 @@ class StoreApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -147,7 +147,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { @@ -157,12 +157,12 @@ class StoreApi { /// Place an order for a pet /// /// - Future placeOrder(Order order) async { - Object postBody = order; + Future placeOrder(Order body) async { + Object postBody = body; // verify required params are set - if(order == null) { - throw ApiException(400, "Missing required param: order"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -173,14 +173,14 @@ class StoreApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart index f7d7e41f8d..8f00081a8c 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api/user_api.dart @@ -10,12 +10,12 @@ class UserApi { /// Create user /// /// This can only be done by the logged in user. - Future createUser(User user) async { - Object postBody = user; + Future createUser(User body) async { + Object postBody = body; // verify required params are set - if(user == null) { - throw ApiException(400, "Missing required param: user"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -26,14 +26,14 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["auth_cookie"]; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -59,12 +59,12 @@ class UserApi { /// Creates list of users with given input array /// /// - Future createUsersWithArrayInput(List user) async { - Object postBody = user; + Future createUsersWithArrayInput(List body) async { + Object postBody = body; // verify required params are set - if(user == null) { - throw ApiException(400, "Missing required param: user"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -75,14 +75,14 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["auth_cookie"]; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -99,7 +99,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -108,12 +108,12 @@ class UserApi { /// Creates list of users with given input array /// /// - Future createUsersWithListInput(List user) async { - Object postBody = user; + Future createUsersWithListInput(List body) async { + Object postBody = body; // verify required params are set - if(user == null) { - throw ApiException(400, "Missing required param: user"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -124,14 +124,14 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["auth_cookie"]; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -148,7 +148,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -158,11 +158,11 @@ class UserApi { /// /// This can only be done by the logged in user. Future deleteUser(String username) async { - Object postBody; + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } // create path and map variables @@ -175,12 +175,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["auth_cookie"]; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -207,11 +207,11 @@ class UserApi { /// /// Future getUserByName(String username) async { - Object postBody; + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } // create path and map variables @@ -224,12 +224,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -246,7 +246,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'User') as User; } else { @@ -257,14 +257,14 @@ class UserApi { /// /// Future loginUser(String username, String password) async { - Object postBody; + Object postBody = null; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } if(password == null) { - throw ApiException(400, "Missing required param: password"); + throw new ApiException(400, "Missing required param: password"); } // create path and map variables @@ -279,12 +279,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -301,7 +301,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; } else { @@ -312,7 +312,7 @@ class UserApi { /// /// Future logoutUser() async { - Object postBody; + Object postBody = null; // verify required params are set @@ -326,12 +326,12 @@ class UserApi { List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["auth_cookie"]; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -348,7 +348,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -357,15 +357,15 @@ class UserApi { /// Updated user /// /// This can only be done by the logged in user. - Future updateUser(String username, User user) async { - Object postBody = user; + Future updateUser(String username, User body) async { + Object postBody = body; // verify required params are set if(username == null) { - throw ApiException(400, "Missing required param: username"); + throw new ApiException(400, "Missing required param: username"); } - if(user == null) { - throw ApiException(400, "Missing required param: user"); + if(body == null) { + throw new ApiException(400, "Missing required param: body"); } // create path and map variables @@ -376,14 +376,14 @@ class UserApi { Map headerParams = {}; Map formParams = {}; - List contentTypes = ["application/json"]; + List contentTypes = []; - String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json"; - List authNames = ["auth_cookie"]; + String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json"; + List authNames = []; if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = MultipartRequest(null, null); + MultipartRequest mp = new MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -400,7 +400,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw ApiException(response.statusCode, _decodeBodyBytes(response)); + throw new ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart index e35c37c020..b99ddeeccb 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_client.dart @@ -10,19 +10,18 @@ class QueryParam { class ApiClient { String basePath; - var client = Client(); + var client = new Client(); Map _defaultHeaderMap = {}; Map _authentications = {}; - final _regList = RegExp(r'^List<(.*)>$'); - final _regMap = RegExp(r'^Map$'); + final _RegList = new RegExp(r'^List<(.*)>$'); + final _RegMap = new RegExp(r'^Map$'); - ApiClient({this.basePath = "http://petstore.swagger.io/v2"}) { + ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { // Setup authentications (key: authentication name, value: authentication). - _authentications['api_key'] = ApiKeyAuth("header", "api_key"); - _authentications['auth_cookie'] = ApiKeyAuth("query", "AUTH_KEY"); - _authentications['petstore_auth'] = OAuth(); + _authentications['api_key'] = new ApiKeyAuth("header", "api_key"); + _authentications['petstore_auth'] = new OAuth(); } void addDefaultHeader(String key, String value) { @@ -41,40 +40,36 @@ class ApiClient { case 'double': return value is double ? value : double.parse('$value'); case 'ApiResponse': - return ApiResponse.fromJson(value); + return new ApiResponse.fromJson(value); case 'Category': - return Category.fromJson(value); - case 'InlineObject': - return InlineObject.fromJson(value); - case 'InlineObject1': - return InlineObject1.fromJson(value); + return new Category.fromJson(value); case 'Order': - return Order.fromJson(value); + return new Order.fromJson(value); case 'Pet': - return Pet.fromJson(value); + return new Pet.fromJson(value); case 'Tag': - return Tag.fromJson(value); + return new Tag.fromJson(value); case 'User': - return User.fromJson(value); + return new User.fromJson(value); default: { Match match; if (value is List && - (match = _regList.firstMatch(targetType)) != null) { + (match = _RegList.firstMatch(targetType)) != null) { var newTargetType = match[1]; return value.map((v) => _deserialize(v, newTargetType)).toList(); } else if (value is Map && - (match = _regMap.firstMatch(targetType)) != null) { + (match = _RegMap.firstMatch(targetType)) != null) { var newTargetType = match[1]; - return Map.fromIterables(value.keys, + return new Map.fromIterables(value.keys, value.values.map((v) => _deserialize(v, newTargetType))); } } } - } on Exception catch (e, stack) { - throw ApiException.withInner(500, 'Exception during deserialization.', e, stack); + } catch (e, stack) { + throw new ApiException.withInner(500, 'Exception during deserialization.', e, stack); } - throw ApiException(500, 'Could not find a suitable class for deserialization'); + throw new ApiException(500, 'Could not find a suitable class for deserialization'); } dynamic deserialize(String json, String targetType) { @@ -83,7 +78,7 @@ class ApiClient { if (targetType == 'String') return json; - var decodedJson = jsonDecode(json); + var decodedJson = JSON.decode(json); return _deserialize(decodedJson, targetType); } @@ -92,7 +87,7 @@ class ApiClient { if (obj == null) { serialized = ''; } else { - serialized = json.encode(obj); + serialized = JSON.encode(obj); } return serialized; } @@ -124,7 +119,7 @@ class ApiClient { headerParams['Content-Type'] = contentType; if(body is MultipartRequest) { - var request = MultipartRequest(method, Uri.parse(url)); + var request = new MultipartRequest(method, Uri.parse(url)); request.fields.addAll(body.fields); request.files.addAll(body.files); request.headers.addAll(body.headers); @@ -153,14 +148,16 @@ class ApiClient { void _updateParamsForAuth(List authNames, List queryParams, Map headerParams) { authNames.forEach((authName) { Authentication auth = _authentications[authName]; - if (auth == null) throw ArgumentError("Authentication undefined: " + authName); + if (auth == null) throw new ArgumentError("Authentication undefined: " + authName); auth.applyToParams(queryParams, headerParams); }); } - T getAuthentication(String name) { - var authentication = _authentications[name]; - - return authentication is T ? authentication : null; + void setAccessToken(String accessToken) { + _authentications.forEach((key, auth) { + if (auth is OAuth) { + auth.setAccessToken(accessToken); + } + }); } } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart index 668abe2c96..f188fd125a 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_exception.dart @@ -2,9 +2,9 @@ part of openapi.api; class ApiException implements Exception { int code = 0; - String message; - Exception innerException; - StackTrace stackTrace; + String message = null; + Exception innerException = null; + StackTrace stackTrace = null; ApiException(this.code, this.message); @@ -17,7 +17,7 @@ class ApiException implements Exception { return "ApiException $code: $message"; } - return "ApiException $code: $message (Inner exception: $innerException)\n\n" + + return "ApiException $code: $message (Inner exception: ${innerException})\n\n" + stackTrace.toString(); } } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart index c57b111ca8..9c1497017e 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/api_helper.dart @@ -11,7 +11,7 @@ Iterable _convertParametersForCollectionFormat( if (name == null || name.isEmpty || value == null) return params; if (value is! List) { - params.add(QueryParam(name, parameterToString(value))); + params.add(new QueryParam(name, parameterToString(value))); return params; } @@ -23,12 +23,12 @@ Iterable _convertParametersForCollectionFormat( : collectionFormat; // default: csv if (collectionFormat == "multi") { - return values.map((v) => QueryParam(name, parameterToString(v))); + return values.map((v) => new QueryParam(name, parameterToString(v))); } String delimiter = _delimiters[collectionFormat] ?? ","; - params.add(QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); + params.add(new QueryParam(name, values.map((v) => parameterToString(v)).join(delimiter))); return params; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart index 8384f0516c..f9617f7ae4 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/api_key_auth.dart @@ -4,24 +4,22 @@ class ApiKeyAuth implements Authentication { final String location; final String paramName; - String _apiKey; + String apiKey; String apiKeyPrefix; - set apiKey(String key) => _apiKey = key; - ApiKeyAuth(this.location, this.paramName); @override void applyToParams(List queryParams, Map headerParams) { String value; if (apiKeyPrefix != null) { - value = '$apiKeyPrefix $_apiKey'; + value = '$apiKeyPrefix $apiKey'; } else { - value = _apiKey; + value = apiKey; } if (location == 'query' && value != null) { - queryParams.add(QueryParam(paramName, value)); + queryParams.add(new QueryParam(paramName, value)); } else if (location == 'header' && value != null) { headerParams[paramName] = value; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart index da931fa263..4e77ddcf6e 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/http_basic_auth.dart @@ -2,15 +2,13 @@ part of openapi.api; class HttpBasicAuth implements Authentication { - String _username; - String _password; + String username; + String password; @override void applyToParams(List queryParams, Map headerParams) { - String str = (_username == null ? "" : _username) + ":" + (_password == null ? "" : _password); - headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str)); + String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + headerParams["Authorization"] = "Basic " + BASE64.encode(UTF8.encode(str)); } - set username(String username) => _username = username; - set password(String password) => _password = password; -} +} \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart index 230471e44f..13bfd79974 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/auth/oauth.dart @@ -1,16 +1,19 @@ part of openapi.api; class OAuth implements Authentication { - String _accessToken; + String accessToken; - OAuth({String accessToken}) : _accessToken = accessToken; + OAuth({this.accessToken}) { + } @override void applyToParams(List queryParams, Map headerParams) { - if (_accessToken != null) { - headerParams["Authorization"] = "Bearer $_accessToken"; + if (accessToken != null) { + headerParams["Authorization"] = "Bearer " + accessToken; } } - set accessToken(String accessToken) => _accessToken = accessToken; + void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart index be01c2de81..f2fddde347 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/api_response.dart @@ -19,39 +19,36 @@ class ApiResponse { if (json['code'] == null) { code = null; } else { - code = json['code']; + code = json['code']; } if (json['type'] == null) { type = null; } else { - type = json['type']; + type = json['type']; } if (json['message'] == null) { message = null; } else { - message = json['message']; + message = json['message']; } } Map toJson() { - Map json = {}; - if (code != null) - json['code'] = code; - if (type != null) - json['type'] = type; - if (message != null) - json['message'] = message; - return json; + return { + 'code': code, + 'type': type, + 'message': message + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => ApiResponse.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = ApiResponse.fromJson(value)); + static Map mapFromJson(Map> json) { + var map = new Map(); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new ApiResponse.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart index 696468a161..1750c6a0ac 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/category.dart @@ -17,32 +17,30 @@ class Category { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; + return { + 'id': id, + 'name': name + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Category.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Category.fromJson(value)); + static Map mapFromJson(Map> json) { + var map = new Map(); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new Category.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart index be5a12e1ed..51d15f7304 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/order.dart @@ -26,17 +26,17 @@ class Order { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['petId'] == null) { petId = null; } else { - petId = json['petId']; + petId = json['petId']; } if (json['quantity'] == null) { quantity = null; } else { - quantity = json['quantity']; + quantity = json['quantity']; } if (json['shipDate'] == null) { shipDate = null; @@ -46,40 +46,34 @@ class Order { if (json['status'] == null) { status = null; } else { - status = json['status']; + status = json['status']; } if (json['complete'] == null) { complete = null; } else { - complete = json['complete']; + complete = json['complete']; } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (petId != null) - json['petId'] = petId; - if (quantity != null) - json['quantity'] = quantity; - if (shipDate != null) - json['shipDate'] = shipDate == null ? null : shipDate.toUtc().toIso8601String(); - if (status != null) - json['status'] = status; - if (complete != null) - json['complete'] = complete; - return json; + return { + 'id': id, + 'petId': petId, + 'quantity': quantity, + 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), + 'status': status, + 'complete': complete + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Order.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new Order.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Order.fromJson(value)); + static Map mapFromJson(Map> json) { + var map = new Map(); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new Order.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart index 4f19829878..c64406368d 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/pet.dart @@ -26,22 +26,22 @@ class Pet { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['category'] == null) { category = null; } else { - category = Category.fromJson(json['category']); + category = new Category.fromJson(json['category']); } if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } if (json['photoUrls'] == null) { photoUrls = null; } else { - photoUrls = (json['photoUrls'] as List).cast(); + photoUrls = (json['photoUrls'] as List).map((item) => item as String).toList(); } if (json['tags'] == null) { tags = null; @@ -51,35 +51,29 @@ class Pet { if (json['status'] == null) { status = null; } else { - status = json['status']; + status = json['status']; } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (category != null) - json['category'] = category; - if (name != null) - json['name'] = name; - if (photoUrls != null) - json['photoUrls'] = photoUrls; - if (tags != null) - json['tags'] = tags; - if (status != null) - json['status'] = status; - return json; + return { + 'id': id, + 'category': category, + 'name': name, + 'photoUrls': photoUrls, + 'tags': tags, + 'status': status + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Pet.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Pet.fromJson(value)); + static Map mapFromJson(Map> json) { + var map = new Map(); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new Pet.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart index a3485e5d3c..980c6e0163 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/tag.dart @@ -17,32 +17,30 @@ class Tag { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['name'] == null) { name = null; } else { - name = json['name']; + name = json['name']; } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (name != null) - json['name'] = name; - return json; + return { + 'id': id, + 'name': name + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => Tag.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = Tag.fromJson(value)); + static Map mapFromJson(Map> json) { + var map = new Map(); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new Tag.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart index 48f061d969..1555eb0a3e 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart +++ b/samples/client/petstore/dart/flutter_petstore/openapi/lib/model/user.dart @@ -29,74 +29,66 @@ class User { if (json['id'] == null) { id = null; } else { - id = json['id']; + id = json['id']; } if (json['username'] == null) { username = null; } else { - username = json['username']; + username = json['username']; } if (json['firstName'] == null) { firstName = null; } else { - firstName = json['firstName']; + firstName = json['firstName']; } if (json['lastName'] == null) { lastName = null; } else { - lastName = json['lastName']; + lastName = json['lastName']; } if (json['email'] == null) { email = null; } else { - email = json['email']; + email = json['email']; } if (json['password'] == null) { password = null; } else { - password = json['password']; + password = json['password']; } if (json['phone'] == null) { phone = null; } else { - phone = json['phone']; + phone = json['phone']; } if (json['userStatus'] == null) { userStatus = null; } else { - userStatus = json['userStatus']; + userStatus = json['userStatus']; } } Map toJson() { - Map json = {}; - if (id != null) - json['id'] = id; - if (username != null) - json['username'] = username; - if (firstName != null) - json['firstName'] = firstName; - if (lastName != null) - json['lastName'] = lastName; - if (email != null) - json['email'] = email; - if (password != null) - json['password'] = password; - if (phone != null) - json['phone'] = phone; - if (userStatus != null) - json['userStatus'] = userStatus; - return json; + return { + 'id': id, + 'username': username, + 'firstName': firstName, + 'lastName': lastName, + 'email': email, + 'password': password, + 'phone': phone, + 'userStatus': userStatus + }; } static List listFromJson(List json) { - return json == null ? List() : json.map((value) => User.fromJson(value)).toList(); + return json == null ? new List() : json.map((value) => new User.fromJson(value)).toList(); } - static Map mapFromJson(Map json) { - var map = Map(); - if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = User.fromJson(value)); + static Map mapFromJson(Map> json) { + var map = new Map(); + if (json != null && json.length > 0) { + json.forEach((String key, Map value) => map[key] = new User.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml index be7bf663b8..b63f835e89 100644 --- a/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml +++ b/samples/client/petstore/dart/flutter_petstore/openapi/pubspec.yaml @@ -1,9 +1,7 @@ name: openapi version: 1.0.0 description: OpenAPI API client -environment: - sdk: '>=2.0.0 <3.0.0' dependencies: - http: '>=0.12.0 <0.13.0' + http: '>=0.11.1 <0.13.0' dev_dependencies: test: ^1.3.0 diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION b/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION index afa6365606..2f81801b79 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/flutter_petstore/swagger/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.travis.yml b/samples/client/petstore/dart/flutter_petstore/swagger/.travis.yml new file mode 100644 index 0000000000..d0758bc9f0 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/.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/dart/flutter_petstore/swagger/README.md b/samples/client/petstore/dart/flutter_petstore/swagger/README.md index 45fe0858b2..e78e0e3e69 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/README.md +++ b/samples/client/petstore/dart/flutter_petstore/swagger/README.md @@ -46,8 +46,8 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md b/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md index 3ec1113828..7b5de3894a 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md +++ b/samples/client/petstore/dart/flutter_petstore/swagger/docs/PetApi.md @@ -30,8 +30,8 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.addPet(body); @@ -72,7 +72,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | Pet id to delete var apiKey = apiKey_example; // String | @@ -118,7 +118,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var status = []; // List | Status values that need to be considered for filter try { @@ -163,7 +163,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var tags = []; // List | Tags to filter by try { @@ -210,7 +210,7 @@ import 'package:openapi/api.dart'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed //defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet to return try { @@ -253,8 +253,8 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); -var body = new Pet(); // Pet | Pet object that needs to be added to the store +var api_instance = PetApi(); +var body = Pet(); // Pet | Pet object that needs to be added to the store try { api_instance.updatePet(body); @@ -295,7 +295,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet that needs to be updated var name = name_example; // String | Updated name of the pet var status = status_example; // String | Updated status of the pet @@ -341,7 +341,7 @@ import 'package:openapi/api.dart'; // TODO Configure OAuth2 access token for authorization: petstore_auth //defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; -var api_instance = new PetApi(); +var api_instance = PetApi(); var petId = 789; // int | ID of pet to update var additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server var file = BINARY_DATA_HERE; // MultipartFile | file to upload diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md b/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md index f3a5e0aba8..1cc37e2a47 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md +++ b/samples/client/petstore/dart/flutter_petstore/swagger/docs/StoreApi.md @@ -26,7 +26,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or non ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); var orderId = orderId_example; // String | ID of the order that needs to be deleted try { @@ -72,7 +72,7 @@ import 'package:openapi/api.dart'; // uncomment below to setup prefix (e.g. Bearer) for API key, if needed //defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); try { var result = api_instance.getInventory(); @@ -111,7 +111,7 @@ For valid response try integer IDs with value <= 5 or > 10. Other values will ge ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); +var api_instance = StoreApi(); var orderId = 789; // int | ID of pet that needs to be fetched try { @@ -152,8 +152,8 @@ Place an order for a pet ```dart import 'package:openapi/api.dart'; -var api_instance = new StoreApi(); -var body = new Order(); // Order | order placed for purchasing the pet +var api_instance = StoreApi(); +var body = Order(); // Order | order placed for purchasing the pet try { var result = api_instance.placeOrder(body); diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md b/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md index 5e0605c6ea..1ee5f6fced 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md +++ b/samples/client/petstore/dart/flutter_petstore/swagger/docs/UserApi.md @@ -30,8 +30,8 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = new User(); // User | Created user object +var api_instance = UserApi(); +var body = User(); // User | Created user object try { api_instance.createUser(body); @@ -70,8 +70,8 @@ Creates list of users with given input array ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var api_instance = UserApi(); +var body = [List<User>()]; // List | List of user object try { api_instance.createUsersWithArrayInput(body); @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -110,8 +110,8 @@ Creates list of users with given input array ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); -var body = [new List<User>()]; // List | List of user object +var api_instance = UserApi(); +var body = [List<User>()]; // List | List of user object try { api_instance.createUsersWithListInput(body); @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -152,7 +152,7 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The name that needs to be deleted try { @@ -192,7 +192,7 @@ Get user by user name ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The name that needs to be fetched. Use user1 for testing. try { @@ -233,7 +233,7 @@ Logs user into the system ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | The user name for login var password = password_example; // String | The password for login in clear text @@ -276,7 +276,7 @@ Logs out current logged in user session ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); try { api_instance.logoutUser(); @@ -314,9 +314,9 @@ This can only be done by the logged in user. ```dart import 'package:openapi/api.dart'; -var api_instance = new UserApi(); +var api_instance = UserApi(); var username = username_example; // String | name that need to be deleted -var body = new User(); // User | Updated user object +var body = User(); // User | Updated user object try { api_instance.updateUser(username, body); diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart index 9670db26fe..35416e655e 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/pet_api.dart @@ -15,7 +15,7 @@ class PetApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -33,7 +33,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -64,7 +64,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -83,7 +83,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -100,7 +100,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -114,7 +114,7 @@ class PetApi { // verify required params are set if(status == null) { - throw new ApiException(400, "Missing required param: status"); + throw ApiException(400, "Missing required param: status"); } // create path and map variables @@ -133,7 +133,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -150,7 +150,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -165,7 +165,7 @@ class PetApi { // verify required params are set if(tags == null) { - throw new ApiException(400, "Missing required param: tags"); + throw ApiException(400, "Missing required param: tags"); } // create path and map variables @@ -184,7 +184,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -201,7 +201,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return (apiClient.deserialize(_decodeBodyBytes(response), 'List') as List).map((item) => item as Pet).toList(); } else { @@ -216,7 +216,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -234,7 +234,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -251,7 +251,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Pet') as Pet; } else { @@ -266,7 +266,7 @@ class PetApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -284,7 +284,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -301,7 +301,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -315,7 +315,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -333,7 +333,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if (name != null) { hasFields = true; mp.fields['name'] = parameterToString(name); @@ -362,7 +362,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -376,7 +376,7 @@ class PetApi { // verify required params are set if(petId == null) { - throw new ApiException(400, "Missing required param: petId"); + throw ApiException(400, "Missing required param: petId"); } // create path and map variables @@ -394,7 +394,7 @@ class PetApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if (additionalMetadata != null) { hasFields = true; mp.fields['additionalMetadata'] = parameterToString(additionalMetadata); @@ -422,7 +422,7 @@ class PetApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'ApiResponse') as ApiResponse; } else { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart index 1296576d4a..59e59725ec 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/store_api.dart @@ -15,7 +15,7 @@ class StoreApi { // verify required params are set if(orderId == null) { - throw new ApiException(400, "Missing required param: orderId"); + throw ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -33,7 +33,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -79,7 +79,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -96,9 +96,9 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { - return new Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); + return Map.from(apiClient.deserialize(_decodeBodyBytes(response), 'Map')); ; } else { return null; @@ -112,7 +112,7 @@ class StoreApi { // verify required params are set if(orderId == null) { - throw new ApiException(400, "Missing required param: orderId"); + throw ApiException(400, "Missing required param: orderId"); } // create path and map variables @@ -130,7 +130,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -147,7 +147,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { @@ -162,7 +162,7 @@ class StoreApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -180,7 +180,7 @@ class StoreApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class StoreApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'Order') as Order; } else { diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart index 4ad3021a1f..475f0655b9 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api/user_api.dart @@ -15,7 +15,7 @@ class UserApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -33,7 +33,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -50,7 +50,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -64,7 +64,7 @@ class UserApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -82,7 +82,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -99,7 +99,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -113,7 +113,7 @@ class UserApi { // verify required params are set if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -131,7 +131,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -148,7 +148,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -162,7 +162,7 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } // create path and map variables @@ -180,7 +180,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -197,7 +197,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -211,7 +211,7 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } // create path and map variables @@ -229,7 +229,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -246,7 +246,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'User') as User; } else { @@ -261,10 +261,10 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } if(password == null) { - throw new ApiException(400, "Missing required param: password"); + throw ApiException(400, "Missing required param: password"); } // create path and map variables @@ -284,7 +284,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -301,7 +301,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; } else { @@ -331,7 +331,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -348,7 +348,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; @@ -362,10 +362,10 @@ class UserApi { // verify required params are set if(username == null) { - throw new ApiException(400, "Missing required param: username"); + throw ApiException(400, "Missing required param: username"); } if(body == null) { - throw new ApiException(400, "Missing required param: body"); + throw ApiException(400, "Missing required param: body"); } // create path and map variables @@ -383,7 +383,7 @@ class UserApi { if(contentType.startsWith("multipart/form-data")) { bool hasFields = false; - MultipartRequest mp = new MultipartRequest(null, null); + MultipartRequest mp = MultipartRequest(null, null); if(hasFields) postBody = mp; } @@ -400,7 +400,7 @@ class UserApi { authNames); if(response.statusCode >= 400) { - throw new ApiException(response.statusCode, _decodeBodyBytes(response)); + throw ApiException(response.statusCode, _decodeBodyBytes(response)); } else if(response.body != null) { } else { return; diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart index 9aed2f92dc..fcf60c919f 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/api_client.dart @@ -18,7 +18,7 @@ class ApiClient { final _regList = RegExp(r'^List<(.*)>$'); final _regMap = RegExp(r'^Map$'); - ApiClient({this.basePath: "http://petstore.swagger.io/v2"}) { + ApiClient({this.basePath = "http://petstore.swagger.io/v2"}) { // Setup authentications (key: authentication name, value: authentication). _authentications['api_key'] = ApiKeyAuth("header", "api_key"); _authentications['petstore_auth'] = OAuth(); diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart index 4ecc4b44dc..be01c2de81 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/api_response.dart @@ -34,21 +34,24 @@ class ApiResponse { } Map toJson() { - return { - 'code': code, - 'type': type, - 'message': message - }; + Map json = {}; + if (code != null) + json['code'] = code; + if (type != null) + json['type'] = type; + if (message != null) + json['message'] = message; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new ApiResponse.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => ApiResponse.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new ApiResponse.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = ApiResponse.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart index f91ffc9b30..696468a161 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/category.dart @@ -27,20 +27,22 @@ class Category { } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Category.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Category.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Category.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Category.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart index d021acb1f8..be5a12e1ed 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/order.dart @@ -56,24 +56,30 @@ class Order { } Map toJson() { - return { - 'id': id, - 'petId': petId, - 'quantity': quantity, - 'shipDate': shipDate == null ? '' : shipDate.toUtc().toIso8601String(), - 'status': status, - 'complete': complete - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (petId != null) + json['petId'] = petId; + if (quantity != null) + json['quantity'] = quantity; + if (shipDate != null) + json['shipDate'] = shipDate == null ? null : shipDate.toUtc().toIso8601String(); + if (status != null) + json['status'] = status; + if (complete != null) + json['complete'] = complete; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Order.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Order.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Order.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Order.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart index 6788af011f..4f19829878 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/pet.dart @@ -31,7 +31,7 @@ class Pet { if (json['category'] == null) { category = null; } else { - category = new Category.fromJson(json['category']); + category = Category.fromJson(json['category']); } if (json['name'] == null) { name = null; @@ -56,24 +56,30 @@ class Pet { } Map toJson() { - return { - 'id': id, - 'category': category, - 'name': name, - 'photoUrls': photoUrls, - 'tags': tags, - 'status': status - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (category != null) + json['category'] = category; + if (name != null) + json['name'] = name; + if (photoUrls != null) + json['photoUrls'] = photoUrls; + if (tags != null) + json['tags'] = tags; + if (status != null) + json['status'] = status; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Pet.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Pet.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Pet.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Pet.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart index 2fae3426b8..a3485e5d3c 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/tag.dart @@ -27,20 +27,22 @@ class Tag { } Map toJson() { - return { - 'id': id, - 'name': name - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (name != null) + json['name'] = name; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new Tag.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => Tag.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new Tag.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = Tag.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart index e3801f4a8f..48f061d969 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/user.dart @@ -69,26 +69,34 @@ class User { } Map toJson() { - return { - 'id': id, - 'username': username, - 'firstName': firstName, - 'lastName': lastName, - 'email': email, - 'password': password, - 'phone': phone, - 'userStatus': userStatus - }; + Map json = {}; + if (id != null) + json['id'] = id; + if (username != null) + json['username'] = username; + if (firstName != null) + json['firstName'] = firstName; + if (lastName != null) + json['lastName'] = lastName; + if (email != null) + json['email'] = email; + if (password != null) + json['password'] = password; + if (phone != null) + json['phone'] = phone; + if (userStatus != null) + json['userStatus'] = userStatus; + return json; } static List listFromJson(List json) { - return json == null ? new List() : json.map((value) => new User.fromJson(value)).toList(); + return json == null ? List() : json.map((value) => User.fromJson(value)).toList(); } static Map mapFromJson(Map json) { - var map = new Map(); + var map = Map(); if (json != null && json.isNotEmpty) { - json.forEach((String key, dynamic value) => map[key] = new User.fromJson(value)); + json.forEach((String key, dynamic value) => map[key] = User.fromJson(value)); } return map; } diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml b/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml index 9ccf0e524a..be7bf663b8 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/pubspec.yaml +++ b/samples/client/petstore/dart/flutter_petstore/swagger/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.12.0 <0.13.0' +dev_dependencies: + test: ^1.3.0 diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/test/api_response_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/api_response_test.dart new file mode 100644 index 0000000000..afd92edde0 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/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 = ApiResponse(); + + 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/swagger/test/category_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/category_test.dart new file mode 100644 index 0000000000..ed39fa7ed8 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/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 = Category(); + + 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/swagger/test/order_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/order_test.dart new file mode 100644 index 0000000000..6102e1e5d0 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/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 = Order(); + + 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/swagger/test/pet_api_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/pet_api_test.dart new file mode 100644 index 0000000000..409b796253 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/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 = 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/swagger/test/pet_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/pet_test.dart new file mode 100644 index 0000000000..83480bd785 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/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 = 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/swagger/test/store_api_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/store_api_test.dart new file mode 100644 index 0000000000..e2c7ab94b1 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/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 = 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/swagger/test/tag_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/tag_test.dart new file mode 100644 index 0000000000..3333ea6d31 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/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 = Tag(); + + 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/swagger/test/user_api_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/user_api_test.dart new file mode 100644 index 0000000000..5d124a6111 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/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 = 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/swagger/test/user_test.dart b/samples/client/petstore/dart/flutter_petstore/swagger/test/user_test.dart new file mode 100644 index 0000000000..35e8eed375 --- /dev/null +++ b/samples/client/petstore/dart/flutter_petstore/swagger/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 = User(); + + 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 06b5019af3..2f81801b79 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.1-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md b/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md index 5e0605c6ea..d3bb61265e 100644 --- a/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md +++ b/samples/client/petstore/dart/openapi-browser-client/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/client/petstore/dart/openapi/.openapi-generator/VERSION b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION index 06b5019af3..2f81801b79 100644 --- a/samples/client/petstore/dart/openapi/.openapi-generator/VERSION +++ b/samples/client/petstore/dart/openapi/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/openapi/docs/UserApi.md b/samples/client/petstore/dart/openapi/docs/UserApi.md index 5e0605c6ea..d3bb61265e 100644 --- a/samples/client/petstore/dart/openapi/docs/UserApi.md +++ b/samples/client/petstore/dart/openapi/docs/UserApi.md @@ -84,7 +84,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -124,7 +124,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type diff --git a/samples/client/petstore/dart2/petstore/pom.xml b/samples/client/petstore/dart2/petstore/pom.xml index f3332da5e1..c4ce7b4d68 100644 --- a/samples/client/petstore/dart2/petstore/pom.xml +++ b/samples/client/petstore/dart2/petstore/pom.xml @@ -62,7 +62,6 @@ pub run - build_runner test diff --git a/samples/client/petstore/dart2/petstore/pubspec.lock b/samples/client/petstore/dart2/petstore/pubspec.lock deleted file mode 100644 index f077e1d442..0000000000 --- a/samples/client/petstore/dart2/petstore/pubspec.lock +++ /dev/null @@ -1,516 +0,0 @@ -# Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile -packages: - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.32.4" - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.4" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.8" - bazel_worker: - dependency: transitive - description: - name: bazel_worker - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.12" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - build: - dependency: transitive - description: - name: build - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.7+3" - build_config: - dependency: transitive - description: - name: build_config - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.1+2" - build_modules: - dependency: transitive - description: - name: build_modules - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.2" - build_resolvers: - dependency: transitive - description: - name: build_resolvers - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.2+3" - build_runner: - dependency: "direct dev" - description: - name: build_runner - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.1+1" - build_runner_core: - dependency: transitive - description: - name: build_runner_core - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.1+4" - build_test: - dependency: "direct dev" - description: - name: build_test - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.3+1" - build_web_compilers: - dependency: "direct dev" - description: - name: build_web_compilers - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2+2" - built_collection: - dependency: transitive - description: - name: built_collection - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.3" - built_value: - dependency: transitive - description: - name: built_value - url: "https://pub.dartlang.org" - source: hosted - version: "5.5.5" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.3+2" - code_builder: - dependency: transitive - description: - name: code_builder - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.2" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.14.11" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.6" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.5" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.3" - fixnum: - dependency: transitive - description: - name: fixnum - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.8" - front_end: - dependency: transitive - description: - name: front_end - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.4" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.7" - graphs: - dependency: transitive - description: - name: graphs - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2+1" - html: - dependency: transitive - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.3+3" - http: - dependency: transitive - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.3+17" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.3" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.3" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.1+1" - json_annotation: - dependency: transitive - description: - name: json_annotation - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - json_rpc_2: - dependency: transitive - description: - name: json_rpc_2 - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.9" - kernel: - dependency: transitive - description: - name: kernel - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.4" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.3+2" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.3+1" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.6+2" - multi_server_socket: - dependency: transitive - description: - name: multi_server_socket - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - node_preamble: - dependency: transitive - description: - name: node_preamble - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.4" - openapi: - dependency: "direct main" - description: - path: "../openapi" - relative: true - source: path - version: "1.0.0" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.5" - package_resolver: - dependency: transitive - description: - name: package_resolver - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.2" - plugin: - dependency: transitive - description: - name: plugin - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0+3" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.6" - protobuf: - dependency: transitive - description: - name: protobuf - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.1" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.2" - pubspec_parse: - dependency: transitive - description: - name: pubspec_parse - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2+2" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.0+1" - scratch_space: - dependency: transitive - description: - name: scratch_space - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.3+1" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "0.7.3+3" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - shelf_static: - dependency: transitive - description: - name: shelf_static - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.8" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.2+4" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.5" - source_maps: - dependency: transitive - description: - name: source_maps - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.7" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.3" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.8" - stream_transform: - dependency: transitive - description: - name: stream_transform - url: "https://pub.dartlang.org" - source: hosted - version: "0.0.14+1" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - test: - dependency: "direct main" - description: - name: test - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.6" - utf: - dependency: transitive - description: - name: utf - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0+5" - vm_service_client: - dependency: transitive - description: - name: vm_service_client - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.6" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.7+10" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.9" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.15" -sdks: - dart: ">=2.0.0 <3.0.0"