forked from loafle/openapi-generator-original
[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:
parent
5e27f11ef1
commit
ba65f675e2
@ -10,7 +10,7 @@ class QueryParam {
|
||||
class ApiClient {
|
||||
|
||||
String basePath;
|
||||
var client = {{#browserClient}}Browser{{/browserClient}}Client();
|
||||
var client = Client();
|
||||
|
||||
Map<String, String> _defaultHeaderMap = {};
|
||||
Map<String, Authentication> _authentications = {};
|
||||
|
@ -1,8 +1,7 @@
|
||||
library {{pubName}}.api;
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';{{#browserClient}}
|
||||
import 'package:http/browser_client.dart';{{/browserClient}}
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart';
|
||||
|
||||
part 'api_client.dart';
|
||||
|
@ -4,6 +4,6 @@ description: {{pubDescription}}
|
||||
environment:
|
||||
sdk: '>=2.0.0 <3.0.0'
|
||||
dependencies:
|
||||
http: '>=0.11.1 <0.13.0'
|
||||
http: '>=0.12.0 <0.13.0'
|
||||
dev_dependencies:
|
||||
test: ^1.3.0
|
||||
|
@ -1 +1 @@
|
||||
4.1.0-SNAPSHOT
|
||||
4.1.1-SNAPSHOT
|
@ -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)
|
||||
|
||||
# **findPetsByTags**
|
||||
> List<Pet> findPetsByTags(tags, maxCount)
|
||||
> List<Pet> findPetsByTags(tags)
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
@ -165,10 +165,9 @@ import 'package:openapi/api.dart';
|
||||
|
||||
var api_instance = PetApi();
|
||||
var tags = []; // List<String> | Tags to filter by
|
||||
var maxCount = 56; // int | Maximum number of items to return
|
||||
|
||||
try {
|
||||
var result = api_instance.findPetsByTags(tags, maxCount);
|
||||
var result = api_instance.findPetsByTags(tags);
|
||||
print(result);
|
||||
} catch (e) {
|
||||
print("Exception when calling PetApi->findPetsByTags: $e\n");
|
||||
@ -180,7 +179,6 @@ try {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tags** | [**List<String>**](String.md)| Tags to filter by | [default to []]
|
||||
**maxCount** | **int**| Maximum number of items to return | [optional] [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
|
@ -160,7 +160,7 @@ class PetApi {
|
||||
/// Finds Pets by tags
|
||||
///
|
||||
/// 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;
|
||||
|
||||
// verify required params are set
|
||||
@ -176,9 +176,6 @@ class PetApi {
|
||||
Map<String, String> headerParams = {};
|
||||
Map<String, String> formParams = {};
|
||||
queryParams.addAll(_convertParametersForCollectionFormat("csv", "tags", tags));
|
||||
if(maxCount != null) {
|
||||
queryParams.addAll(_convertParametersForCollectionFormat("", "maxCount", maxCount));
|
||||
}
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
|
@ -4,6 +4,6 @@ description: OpenAPI API client
|
||||
environment:
|
||||
sdk: '>=2.0.0 <3.0.0'
|
||||
dependencies:
|
||||
http: '>=0.11.1 <0.13.0'
|
||||
http: '>=0.12.0 <0.13.0'
|
||||
dev_dependencies:
|
||||
test: ^1.3.0
|
||||
|
@ -1 +1 @@
|
||||
4.1.0-SNAPSHOT
|
||||
4.1.1-SNAPSHOT
|
@ -4,6 +4,6 @@ description: OpenAPI API client
|
||||
environment:
|
||||
sdk: '>=2.0.0 <3.0.0'
|
||||
dependencies:
|
||||
http: '>=0.11.1 <0.13.0'
|
||||
http: '>=0.12.0 <0.13.0'
|
||||
dev_dependencies:
|
||||
test: ^1.3.0
|
||||
|
@ -1 +1 @@
|
||||
4.1.0-SNAPSHOT
|
||||
4.1.1-SNAPSHOT
|
@ -2,7 +2,6 @@ library openapi.api;
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'package:http/browser_client.dart';
|
||||
import 'package:http/http.dart';
|
||||
|
||||
part 'api_client.dart';
|
||||
|
@ -10,7 +10,7 @@ class QueryParam {
|
||||
class ApiClient {
|
||||
|
||||
String basePath;
|
||||
var client = BrowserClient();
|
||||
var client = Client();
|
||||
|
||||
Map<String, String> _defaultHeaderMap = {};
|
||||
Map<String, Authentication> _authentications = {};
|
||||
|
@ -4,6 +4,6 @@ description: OpenAPI API client
|
||||
environment:
|
||||
sdk: '>=2.0.0 <3.0.0'
|
||||
dependencies:
|
||||
http: '>=0.11.1 <0.13.0'
|
||||
http: '>=0.12.0 <0.13.0'
|
||||
dev_dependencies:
|
||||
test: ^1.3.0
|
||||
|
@ -1 +1 @@
|
||||
4.1.0-SNAPSHOT
|
||||
4.1.1-SNAPSHOT
|
@ -4,6 +4,6 @@ description: OpenAPI API client
|
||||
environment:
|
||||
sdk: '>=2.0.0 <3.0.0'
|
||||
dependencies:
|
||||
http: '>=0.11.1 <0.13.0'
|
||||
http: '>=0.12.0 <0.13.0'
|
||||
dev_dependencies:
|
||||
test: ^1.3.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user