[Dart] Make clients crossplatform (#3608)

* Remove browserClient flag and bump http dependency

* Run shell scripts so CIs can verify the change
This commit is contained in:
Nick Meinhold 2019-08-13 17:35:00 +10:00 committed by William Cheng
parent 5e27f11ef1
commit ba65f675e2
15 changed files with 15 additions and 22 deletions

View File

@ -10,7 +10,7 @@ class QueryParam {
class ApiClient { class ApiClient {
String basePath; String basePath;
var client = {{#browserClient}}Browser{{/browserClient}}Client(); var client = Client();
Map<String, String> _defaultHeaderMap = {}; Map<String, String> _defaultHeaderMap = {};
Map<String, Authentication> _authentications = {}; Map<String, Authentication> _authentications = {};

View File

@ -1,8 +1,7 @@
library {{pubName}}.api; library {{pubName}}.api;
import 'dart:async'; import 'dart:async';
import 'dart:convert';{{#browserClient}} import 'dart:convert';
import 'package:http/browser_client.dart';{{/browserClient}}
import 'package:http/http.dart'; import 'package:http/http.dart';
part 'api_client.dart'; part 'api_client.dart';

View File

@ -4,6 +4,6 @@ description: {{pubDescription}}
environment: environment:
sdk: '>=2.0.0 <3.0.0' sdk: '>=2.0.0 <3.0.0'
dependencies: dependencies:
http: '>=0.11.1 <0.13.0' http: '>=0.12.0 <0.13.0'
dev_dependencies: dev_dependencies:
test: ^1.3.0 test: ^1.3.0

View File

@ -1 +1 @@
4.1.0-SNAPSHOT 4.1.1-SNAPSHOT

View File

@ -151,7 +151,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) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **findPetsByTags** # **findPetsByTags**
> List<Pet> findPetsByTags(tags, maxCount) > List<Pet> findPetsByTags(tags)
Finds Pets by tags Finds Pets by tags
@ -165,10 +165,9 @@ import 'package:openapi/api.dart';
var api_instance = PetApi(); var api_instance = PetApi();
var tags = []; // List<String> | Tags to filter by var tags = []; // List<String> | Tags to filter by
var maxCount = 56; // int | Maximum number of items to return
try { try {
var result = api_instance.findPetsByTags(tags, maxCount); var result = api_instance.findPetsByTags(tags);
print(result); print(result);
} catch (e) { } catch (e) {
print("Exception when calling PetApi->findPetsByTags: $e\n"); print("Exception when calling PetApi->findPetsByTags: $e\n");
@ -180,7 +179,6 @@ try {
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**tags** | [**List&lt;String&gt;**](String.md)| Tags to filter by | [default to []] **tags** | [**List&lt;String&gt;**](String.md)| Tags to filter by | [default to []]
**maxCount** | **int**| Maximum number of items to return | [optional] [default to null]
### Return type ### Return type

View File

@ -160,7 +160,7 @@ class PetApi {
/// Finds Pets by tags /// Finds Pets by tags
/// ///
/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Future<List<Pet>> findPetsByTags(List<String> tags, { int maxCount }) async { Future<List<Pet>> findPetsByTags(List<String> tags) async {
Object postBody; Object postBody;
// verify required params are set // verify required params are set
@ -176,9 +176,6 @@ class PetApi {
Map<String, String> headerParams = {}; Map<String, String> headerParams = {};
Map<String, String> formParams = {}; Map<String, String> formParams = {};
queryParams.addAll(_convertParametersForCollectionFormat("csv", "tags", tags)); queryParams.addAll(_convertParametersForCollectionFormat("csv", "tags", tags));
if(maxCount != null) {
queryParams.addAll(_convertParametersForCollectionFormat("", "maxCount", maxCount));
}
List<String> contentTypes = []; List<String> contentTypes = [];

View File

@ -4,6 +4,6 @@ description: OpenAPI API client
environment: environment:
sdk: '>=2.0.0 <3.0.0' sdk: '>=2.0.0 <3.0.0'
dependencies: dependencies:
http: '>=0.11.1 <0.13.0' http: '>=0.12.0 <0.13.0'
dev_dependencies: dev_dependencies:
test: ^1.3.0 test: ^1.3.0

View File

@ -1 +1 @@
4.1.0-SNAPSHOT 4.1.1-SNAPSHOT

View File

@ -4,6 +4,6 @@ description: OpenAPI API client
environment: environment:
sdk: '>=2.0.0 <3.0.0' sdk: '>=2.0.0 <3.0.0'
dependencies: dependencies:
http: '>=0.11.1 <0.13.0' http: '>=0.12.0 <0.13.0'
dev_dependencies: dev_dependencies:
test: ^1.3.0 test: ^1.3.0

View File

@ -1 +1 @@
4.1.0-SNAPSHOT 4.1.1-SNAPSHOT

View File

@ -2,7 +2,6 @@ library openapi.api;
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'package:http/browser_client.dart';
import 'package:http/http.dart'; import 'package:http/http.dart';
part 'api_client.dart'; part 'api_client.dart';

View File

@ -10,7 +10,7 @@ class QueryParam {
class ApiClient { class ApiClient {
String basePath; String basePath;
var client = BrowserClient(); var client = Client();
Map<String, String> _defaultHeaderMap = {}; Map<String, String> _defaultHeaderMap = {};
Map<String, Authentication> _authentications = {}; Map<String, Authentication> _authentications = {};

View File

@ -4,6 +4,6 @@ description: OpenAPI API client
environment: environment:
sdk: '>=2.0.0 <3.0.0' sdk: '>=2.0.0 <3.0.0'
dependencies: dependencies:
http: '>=0.11.1 <0.13.0' http: '>=0.12.0 <0.13.0'
dev_dependencies: dev_dependencies:
test: ^1.3.0 test: ^1.3.0

View File

@ -1 +1 @@
4.1.0-SNAPSHOT 4.1.1-SNAPSHOT

View File

@ -4,6 +4,6 @@ description: OpenAPI API client
environment: environment:
sdk: '>=2.0.0 <3.0.0' sdk: '>=2.0.0 <3.0.0'
dependencies: dependencies:
http: '>=0.11.1 <0.13.0' http: '>=0.12.0 <0.13.0'
dev_dependencies: dev_dependencies:
test: ^1.3.0 test: ^1.3.0