Merge remote-tracking branch 'origin/5.3.x' into 6.0.x

This commit is contained in:
William Cheng
2021-07-12 17:11:35 +08:00
3874 changed files with 120282 additions and 21640 deletions

View File

@@ -1,2 +0,0 @@
analyzer:
strong-mode: true

View File

@@ -1,13 +1,18 @@
name: petstore_client
version: 1.0.0
description: Petstore client using OpenAPI library
publish_to: none
environment:
sdk: '>=2.5.0 <3.0.0'
sdk: '>=2.11.0 <3.0.0'
dependencies:
openapi:
path: ../petstore_client_lib
dev_dependencies:
test: ^1.8.0
mockito: ^4.1.1
http: ^0.12.0
http: ^0.13.0
collection: ^1.14.12

View File

@@ -21,9 +21,9 @@ class FakeClient extends Fake implements Client {
this.expectedPutRequestBody,
this.putResponseBody,
this.sendResponseBody,
this.expectedUrl,
String expectedUrl,
this.expectedHeaders = null,
});
}) : this.expectedUrl = Uri.parse(expectedUrl);
Exception throwException;
Object expectedPostRequestBody;
@@ -34,12 +34,12 @@ class FakeClient extends Fake implements Client {
String expectedPutRequestBody;
String putResponseBody;
String sendResponseBody;
String expectedUrl;
Uri expectedUrl;
Map<String, String> expectedHeaders;
@override
Future<Response> post(url,
{Map<String, String> headers, body, Encoding encoding}) async {
Future<Response> post(Uri url,
{Map<String, String> headers, Object body, Encoding encoding}) async {
// check that the request was made with expected values
if (url != expectedUrl) {
throw StateError(
@@ -67,7 +67,7 @@ class FakeClient extends Fake implements Client {
}
@override
Future<Response> get(url, {Map<String, String> headers}) async {
Future<Response> get(Uri url, {Map<String, String> headers}) async {
// check that the request was made with expected values
if (url != expectedUrl) {
throw StateError(
@@ -85,7 +85,8 @@ class FakeClient extends Fake implements Client {
}
@override
Future<Response> delete(url, {Map<String, String> headers}) async {
Future<Response> delete(Uri url,
{Map<String, String> headers, Object body, Encoding encoding}) async {
// check that the request was made with expected values
if (url != expectedUrl) {
throw StateError(
@@ -103,8 +104,8 @@ class FakeClient extends Fake implements Client {
}
@override
Future<Response> put(url,
{Map<String, String> headers, body, Encoding encoding}) async {
Future<Response> put(Uri url,
{Map<String, String> headers, Object body, Encoding encoding}) async {
// check that the request was made with expected values
if (url != expectedUrl) {
throw StateError(

View File

@@ -2,8 +2,8 @@ import 'package:openapi/api.dart';
import 'package:test/test.dart';
void main() {
test('Check if default value is generated', () async {
var order = Order();
expect(order.complete, equals(false));
});
test('Check if default value is generated', () async {
var order = Order();
expect(order.complete, equals(false));
});
}

View File

@@ -26,11 +26,10 @@ void main() {
..id = 124321
..name = 'Jose'
];
return Pet()
return Pet(name: name)
..id = id
..category = category
..tags = tags
..name = name
..status = PetStatusEnum.fromJson(status)
..photoUrls = ['https://petstore.com/sample/photo1.jpg'];
}
@@ -53,8 +52,7 @@ void main() {
// use the pet api to add a pet
petApi.apiClient.client = FakeClient(
expectedUrl: 'http://petstore.swagger.io/v2/pet',
expectedPostRequestBody:
await petApi.apiClient.serializeAsync(newPet),
expectedPostRequestBody: await petApi.apiClient.serializeAsync(newPet),
postResponseBody: await petApi.apiClient.serializeAsync(newPet),
expectedHeaders: {'Content-Type': 'application/json'});
await petApi.addPet(newPet);
@@ -76,8 +74,7 @@ void main() {
expectedUrl: 'http://petstore.swagger.io/v2/pet/$id',
throwException: ApiException(400, 'not found'),
);
expect(
petApi.getPetById(id), throwsA(equals(TypeMatcher<ApiException>())));
expect(petApi.getPetById(id), throwsA(equals(TypeMatcher<ApiException>())));
});
test('deletes existing pet by id', () async {
@@ -87,8 +84,7 @@ void main() {
// add a new pet
petApi.apiClient.client = FakeClient(
expectedUrl: 'http://petstore.swagger.io/v2/pet',
expectedPostRequestBody:
await petApi.apiClient.serializeAsync(newPet),
expectedPostRequestBody: await petApi.apiClient.serializeAsync(newPet),
postResponseBody: await petApi.apiClient.serializeAsync(newPet),
expectedHeaders: {'Content-Type': 'application/json'});
await petApi.addPet(newPet);
@@ -106,8 +102,7 @@ void main() {
expectedUrl: 'http://petstore.swagger.io/v2/pet/$id',
throwException: ApiException(400, 'Not found'),
);
expect(
petApi.getPetById(id), throwsA(equals(TypeMatcher<ApiException>())));
expect(petApi.getPetById(id), throwsA(equals(TypeMatcher<ApiException>())));
});
test('updates pet with form', () async {
@@ -117,16 +112,11 @@ void main() {
// add a new pet
petApi.apiClient.client = FakeClient(
expectedUrl: 'http://petstore.swagger.io/v2/pet',
expectedPostRequestBody:
await petApi.apiClient.serializeAsync(newPet),
expectedPostRequestBody: await petApi.apiClient.serializeAsync(newPet),
postResponseBody: await petApi.apiClient.serializeAsync(newPet),
expectedHeaders: {'Content-Type': 'application/json'});
await petApi.addPet(newPet);
final multipartRequest = MultipartRequest(null, null);
multipartRequest.fields['name'] = 'Doge';
multipartRequest.fields['status'] = '';
// update with form
petApi.apiClient.client = FakeClient(
expectedUrl: 'http://petstore.swagger.io/v2/pet/$id',
@@ -157,8 +147,7 @@ void main() {
// add a new pet
petApi.apiClient.client = FakeClient(
expectedUrl: 'http://petstore.swagger.io/v2/pet',
expectedPostRequestBody:
await petApi.apiClient.serializeAsync(newPet),
expectedPostRequestBody: await petApi.apiClient.serializeAsync(newPet),
postResponseBody: await petApi.apiClient.serializeAsync(newPet),
expectedHeaders: {'Content-Type': 'application/json'});
await petApi.addPet(newPet);
@@ -166,8 +155,7 @@ void main() {
// update the same pet
petApi.apiClient.client = FakeClient(
expectedUrl: 'http://petstore.swagger.io/v2/pet',
expectedPutRequestBody:
await petApi.apiClient.serializeAsync(updatePet),
expectedPutRequestBody: await petApi.apiClient.serializeAsync(updatePet),
putResponseBody: await petApi.apiClient.serializeAsync(updatePet),
expectedHeaders: {'Content-Type': 'application/json'});
await petApi.updatePet(updatePet);
@@ -196,15 +184,13 @@ void main() {
// retrieve pets by status
petApi.apiClient.client = FakeClient(
expectedUrl:
'http://petstore.swagger.io/v2/pet/findByStatus?status=$status',
expectedUrl: 'http://petstore.swagger.io/v2/pet/findByStatus?status=$status',
getResponseBody: await petApi.apiClient.serializeAsync([pet1, pet2]),
);
final pets = await petApi.findPetsByStatus([status]);
// tests serialisation and deserialisation of enum
final petsByStatus =
pets.where((p) => p.status == PetStatusEnum.available);
final petsByStatus = pets.where((p) => p.status == PetStatusEnum.available);
expect(petsByStatus.length, equals(2));
final petIds = pets.map((pet) => pet.id).toList();
expect(petIds, contains(id1));
@@ -216,14 +202,12 @@ void main() {
final id = newId();
final newPet = makePet(id: id);
// get some test data (recorded from live response)
final uploadResponse =
await File('test/file_upload_response.json').readAsString();
final uploadResponse = await File('test/file_upload_response.json').readAsString();
// add a new pet
petApi.apiClient.client = FakeClient(
expectedUrl: 'http://petstore.swagger.io/v2/pet',
expectedPostRequestBody:
await petApi.apiClient.serializeAsync(newPet),
expectedPostRequestBody: await petApi.apiClient.serializeAsync(newPet),
postResponseBody: await petApi.apiClient.serializeAsync(newPet),
expectedHeaders: {'Content-Type': 'application/json'});
await petApi.addPet(newPet);
@@ -232,9 +216,8 @@ void main() {
expectedUrl: 'http://petstore.swagger.io/v2/pet',
sendResponseBody: uploadResponse,
);
final file =
new MultipartFile.fromBytes('file', [104, 101, 108, 108, 111]);
await petApi.uploadFile(id, additionalMetadata: '', file: file);
final file = new MultipartFile.fromBytes('file', [104, 101, 108, 108, 111]);
await petApi.uploadFile(id, file: file);
});
});
}

View File

@@ -1,5 +1,4 @@
import 'dart:async';
@Skip('Needs real petstore')
import 'package:http/http.dart';
import 'package:openapi/api.dart';
import 'package:test/test.dart';
@@ -46,16 +45,14 @@ void main() {
});
test('doesn\'t get non-existing pet by id', () {
expect(petApi.getPetById(newId()),
throwsA(equals(TypeMatcher<ApiException>())));
expect(petApi.getPetById(newId()), throwsA(equals(TypeMatcher<ApiException>())));
});
test('deletes existing pet by id', () async {
var id = newId();
await petApi.addPet(makePet(id: id));
await petApi.deletePet(id, apiKey: 'special-key');
expect(
petApi.getPetById(id), throwsA(equals(TypeMatcher<ApiException>())));
expect(petApi.getPetById(id), throwsA(equals(TypeMatcher<ApiException>())));
});
test('updates pet with form', () async {
@@ -100,5 +97,5 @@ void main() {
var file = new MultipartFile.fromBytes('file', [104, 101, 108, 108, 111]);
await petApi.uploadFile(id, additionalMetadata: '', file: file);
});
}, skip: 'e2e tests for CI');
});
}

View File

@@ -4,4 +4,4 @@ final _random = new Random();
int newId() {
return _random.nextInt(999999);
}
}

View File

@@ -21,62 +21,56 @@ void main() {
group('Store API with faked client', () {
test('places an order and gets it by id', () async {
// TODO: Please uncomment this after a content type of the petstore order in petstore.yaml is fixed.
// final id = newId();
// final newOrder = makeOrder(id: id);
final id = newId();
final newOrder = makeOrder(id: id);
// // use the store api to add an order
// storeApi.apiClient.client = FakeClient(
// expectedUrl: 'http://petstore.swagger.io/v2/store/order',
// expectedPostRequestBody: await storeApi.apiClient.serializeAsync(newOrder),
// postResponseBody: await storeApi.apiClient.serializeAsync(newOrder),
// expectedHeaders: {"Content-Type": "application/json"}
// );
// await storeApi.placeOrder(newOrder);
// use the store api to add an order
storeApi.apiClient.client = FakeClient(
expectedUrl: 'http://petstore.swagger.io/v2/store/order',
expectedPostRequestBody: await storeApi.apiClient.serializeAsync(newOrder),
postResponseBody: await storeApi.apiClient.serializeAsync(newOrder),
expectedHeaders: {"Content-Type": "application/json"});
await storeApi.placeOrder(newOrder);
// // retrieve the same order by id
// storeApi.apiClient.client = FakeClient(
// expectedUrl: 'http://petstore.swagger.io/v2/store/order/$id',
// getResponseBody: await storeApi.apiClient.serializeAsync(newOrder),
// );
// final placedOrder = await storeApi.getOrderById(id);
// expect(placedOrder.id, equals(id));
// retrieve the same order by id
storeApi.apiClient.client = FakeClient(
expectedUrl: 'http://petstore.swagger.io/v2/store/order/$id',
getResponseBody: await storeApi.apiClient.serializeAsync(newOrder),
);
final placedOrder = await storeApi.getOrderById(id);
expect(placedOrder.id, equals(id));
});
test('deletes an order', () async {
// TODO: Please uncomment this after a content type of the petstore order in petstore.yaml is fixed.
// final id = newId();
// final newOrder = makeOrder(id: id);
final id = newId();
final newOrder = makeOrder(id: id);
// // use the store api to add an order
// storeApi.apiClient.client = FakeClient(
// expectedUrl: 'http://petstore.swagger.io/v2/store/order',
// expectedPostRequestBody: await storeApi.apiClient.serializeAsync(newOrder),
// postResponseBody: await storeApi.apiClient.serializeAsync(newOrder),
// expectedHeaders: {"Content-Type": "application/json"}
// );
// await storeApi.placeOrder(newOrder);
// use the store api to add an order
storeApi.apiClient.client = FakeClient(
expectedUrl: 'http://petstore.swagger.io/v2/store/order',
expectedPostRequestBody: await storeApi.apiClient.serializeAsync(newOrder),
postResponseBody: await storeApi.apiClient.serializeAsync(newOrder),
expectedHeaders: {"Content-Type": "application/json"});
await storeApi.placeOrder(newOrder);
// // delete the same order
// storeApi.apiClient.client = FakeClient(
// expectedUrl: 'http://petstore.swagger.io/v2/store/order/$id',
// deleteResponseBody: '',
// );
// await storeApi.deleteOrder(id.toString());
// delete the same order
storeApi.apiClient.client = FakeClient(
expectedUrl: 'http://petstore.swagger.io/v2/store/order/$id',
deleteResponseBody: '',
);
await storeApi.deleteOrder(id.toString());
// // try and retrieve the order
// storeApi.apiClient.client = FakeClient(
// expectedUrl: 'http://petstore.swagger.io/v2/store/order/$id',
// throwException: ApiException(400, 'Not found'),
// );
// expect(storeApi.getOrderById(id),
// throwsA(equals(TypeMatcher<ApiException>())));
// try and retrieve the order
storeApi.apiClient.client = FakeClient(
expectedUrl: 'http://petstore.swagger.io/v2/store/order/$id',
throwException: ApiException(400, 'Not found'),
);
expect(storeApi.getOrderById(id), throwsA(equals(TypeMatcher<ApiException>())));
});
test('gets the store inventory', () async {
// get some test data (recorded from live response)
final inventoryResponse =
await File('test/inventory_response.json').readAsString();
final inventoryResponse = await File('test/inventory_response.json').readAsString();
// use the store api to get the inventory
storeApi.apiClient.client = FakeClient(
expectedUrl: 'http://petstore.swagger.io/v2/store/inventory',

View File

@@ -1,3 +1,4 @@
@Skip('Needs real petstore')
import 'package:openapi/api.dart';
import 'package:test/test.dart';
@@ -18,27 +19,24 @@ void main() {
group('Store API with live client', () {
test('places an order and gets it by id', () async {
// TODO: Please uncomment this after a content type of the petstore order in petstore.yaml is fixed.
// var id = newId();
var id = newId();
// await storeApi.placeOrder(makeOrder(id: id));
// var order = await storeApi.getOrderById(id);
// expect(order.id, equals(id));
await storeApi.placeOrder(makeOrder(id: id));
var order = await storeApi.getOrderById(id);
expect(order.id, equals(id));
});
test('deletes an order', () async {
// TODO: Please uncomment this after a content type of the petstore order in petstore.yaml is fixed.
// var id = newId();
var id = newId();
// await storeApi.placeOrder(makeOrder(id: id));
// await storeApi.deleteOrder(id.toString());
// expect(storeApi.getOrderById(id),
// throwsA(equals(TypeMatcher<ApiException>())));
await storeApi.placeOrder(makeOrder(id: id));
await storeApi.deleteOrder(id.toString());
expect(storeApi.getOrderById(id), throwsA(equals(TypeMatcher<ApiException>())));
});
test('gets the store inventory', () async {
Map<String, int> inventory = await storeApi.getInventory();
expect(inventory.length, isNot(equals(0)));
});
}); // , skip: 'e2e tests for CI'
});
}

View File

@@ -1,3 +1,4 @@
@Skip('Needs real petstore')
import 'package:openapi/api.dart';
import 'package:test/test.dart';
@@ -6,8 +7,7 @@ import 'random_id.dart';
void main() {
var userApi = new UserApi();
User makeUser(
{int id, String userName = 'username', String password = 'password'}) {
User makeUser({int id, String userName = 'username', String password = 'password'}) {
return User()
..id = id
..username = userName
@@ -63,8 +63,7 @@ void main() {
var username = 'Riddlem325';
await userApi.createUser(makeUser(id: newId(), userName: username));
await userApi.deleteUser(username);
expect(userApi.getUserByName(username),
throwsA(TypeMatcher<ApiException>()));
expect(userApi.getUserByName(username), throwsA(TypeMatcher<ApiException>()));
});
test('logs a user in', () async {
@@ -76,5 +75,5 @@ void main() {
var result = await userApi.loginUser(username, password);
expect(result, contains('logged in user session:'));
});
}, skip: 'e2e tests for CI');
});
}

View File

@@ -1,6 +1,7 @@
.gitignore
.travis.yml
README.md
analysis_options.yaml
doc/ApiResponse.md
doc/Category.md
doc/Order.md

View File

@@ -1 +1,5 @@
6.0.0-SNAPSHOT
<<<<<<< HEAD
6.0.0-SNAPSHOT
=======
5.3.0-SNAPSHOT
>>>>>>> origin/5.3.x

View File

@@ -0,0 +1,3 @@
analyzer:
strong-mode:
implicit-casts: true

View File

@@ -41,17 +41,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -118,17 +107,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -187,17 +165,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -265,17 +232,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -342,17 +298,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -414,17 +359,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -491,30 +425,11 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (name != null) {
hasFields = true;
mp.fields[r'name'] = parameterToString(name);
}
if (status != null) {
hasFields = true;
mp.fields[r'status'] = parameterToString(status);
}
if (hasFields) {
postBody = mp;
}
} else {
if (name != null) {
formParams[r'name'] = parameterToString(name);
}
if (status != null) {
formParams[r'status'] = parameterToString(status);
}
if (name != null) {
formParams[r'name'] = parameterToString(name);
}
if (status != null) {
formParams[r'status'] = parameterToString(status);
}
return await apiClient.invokeAPI(
@@ -581,28 +496,19 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (additionalMetadata != null) {
hasFields = true;
mp.fields[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
if (file != null) {
hasFields = true;
mp.fields[r'file'] = file.field;
mp.files.add(file);
}
if (hasFields) {
postBody = mp;
}
} else {
if (additionalMetadata != null) {
formParams[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
bool hasFields = false;
final mp = MultipartRequest('POST', Uri.parse(path));
if (additionalMetadata != null) {
hasFields = true;
mp.fields[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
if (file != null) {
hasFields = true;
mp.fields[r'file'] = file.field;
mp.files.add(file);
}
if (hasFields) {
postBody = mp;
}
return await apiClient.invokeAPI(

View File

@@ -44,17 +44,6 @@ class StoreApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -101,17 +90,6 @@ class StoreApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -171,17 +149,6 @@ class StoreApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -243,17 +210,6 @@ class StoreApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -43,17 +43,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -108,17 +97,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -171,17 +149,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -237,17 +204,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -303,17 +259,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -382,17 +327,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -445,17 +379,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -512,17 +435,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -58,7 +58,7 @@ class ApiClient {
Future<Response> invokeAPI(
String path,
String method,
Iterable<QueryParam> queryParams,
List<QueryParam> queryParams,
Object body,
Map<String, String> headerParams,
Map<String, String> formParams,
@@ -168,13 +168,13 @@ class ApiClient {
List<QueryParam> queryParams,
Map<String, String> headerParams,
) {
authNames.forEach((authName) {
for(final authName in authNames) {
final auth = _authentications[authName];
if (auth == null) {
throw ArgumentError('Authentication undefined: $authName');
}
auth.applyToParams(queryParams, headerParams);
});
}
}
static dynamic _deserialize(dynamic value, String targetType, {bool growable}) {

View File

@@ -19,6 +19,7 @@ class ApiException implements Exception {
Exception innerException;
StackTrace stackTrace;
@override
String toString() {
if (message == null) {
return 'ApiException';

View File

@@ -28,7 +28,7 @@ Iterable<QueryParam> _convertParametersForCollectionFormat(
final params = <QueryParam>[];
// preconditions
if (name != null && !name.isEmpty && value != null) {
if (name != null && name.isNotEmpty && value != null) {
if (value is List) {
// get the collection format, default: csv
collectionFormat = (collectionFormat == null || collectionFormat.isEmpty)

View File

@@ -65,12 +65,12 @@ class ApiResponse {
static List<ApiResponse> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ApiResponse>[]
: json.map((v) => ApiResponse.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => ApiResponse.fromJson(value)).toList(growable: true == growable);
static Map<String, ApiResponse> mapFromJson(Map<String, dynamic> json) {
final map = <String, ApiResponse>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ApiResponse.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = ApiResponse.fromJson(value));
}
return map;
}
@@ -78,9 +78,9 @@ class ApiResponse {
// maps a json object with a list of ApiResponse-objects as value to a dart map
static Map<String, List<ApiResponse>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ApiResponse>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ApiResponse.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = ApiResponse.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -56,12 +56,12 @@ class Category {
static List<Category> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Category>[]
: json.map((v) => Category.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Category.fromJson(value)).toList(growable: true == growable);
static Map<String, Category> mapFromJson(Map<String, dynamic> json) {
final map = <String, Category>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Category.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Category.fromJson(value));
}
return map;
}
@@ -69,9 +69,9 @@ class Category {
// maps a json object with a list of Category-objects as value to a dart map
static Map<String, List<Category>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Category>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Category.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Category.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -95,12 +95,12 @@ class Order {
static List<Order> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Order>[]
: json.map((v) => Order.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Order.fromJson(value)).toList(growable: true == growable);
static Map<String, Order> mapFromJson(Map<String, dynamic> json) {
final map = <String, Order>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Order.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Order.fromJson(value));
}
return map;
}
@@ -108,9 +108,9 @@ class Order {
// maps a json object with a list of Order-objects as value to a dart map
static Map<String, List<Order>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Order>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Order.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Order.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -91,12 +91,12 @@ class Pet {
static List<Pet> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Pet>[]
: json.map((v) => Pet.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Pet.fromJson(value)).toList(growable: true == growable);
static Map<String, Pet> mapFromJson(Map<String, dynamic> json) {
final map = <String, Pet>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Pet.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Pet.fromJson(value));
}
return map;
}
@@ -104,9 +104,9 @@ class Pet {
// maps a json object with a list of Pet-objects as value to a dart map
static Map<String, List<Pet>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Pet>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Pet.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Pet.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -56,12 +56,12 @@ class Tag {
static List<Tag> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Tag>[]
: json.map((v) => Tag.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Tag.fromJson(value)).toList(growable: true == growable);
static Map<String, Tag> mapFromJson(Map<String, dynamic> json) {
final map = <String, Tag>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Tag.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Tag.fromJson(value));
}
return map;
}
@@ -69,9 +69,9 @@ class Tag {
// maps a json object with a list of Tag-objects as value to a dart map
static Map<String, List<Tag>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Tag>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Tag.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Tag.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -111,12 +111,12 @@ class User {
static List<User> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <User>[]
: json.map((v) => User.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => User.fromJson(value)).toList(growable: true == growable);
static Map<String, User> mapFromJson(Map<String, dynamic> json) {
final map = <String, User>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = User.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = User.fromJson(value));
}
return map;
}
@@ -124,9 +124,9 @@ class User {
// maps a json object with a list of User-objects as value to a dart map
static Map<String, List<User>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<User>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = User.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = User.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -5,8 +5,6 @@
name: 'openapi'
version: '1.0.0'
description: 'OpenAPI API client'
authors:
- 'Author <author@homepage>'
homepage: 'homepage'
environment:
sdk: '>=2.12.0 <3.0.0'

View File

@@ -1,6 +1,7 @@
.gitignore
.travis.yml
README.md
analysis_options.yaml
doc/AdditionalPropertiesClass.md
doc/Animal.md
doc/AnotherFakeApi.md

View File

@@ -1 +1,5 @@
6.0.0-SNAPSHOT
<<<<<<< HEAD
6.0.0-SNAPSHOT
=======
5.3.0-SNAPSHOT
>>>>>>> origin/5.3.x

View File

@@ -67,6 +67,7 @@ Class | Method | HTTP request | Description
*FakeApi* | [**fakeOuterNumberSerialize**](doc//FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
*FakeApi* | [**fakeOuterStringSerialize**](doc//FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
*FakeApi* | [**fakePropertyEnumIntegerSerialize**](doc//FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
*FakeApi* | [**testBodyWithBinary**](doc//FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
*FakeApi* | [**testBodyWithFileSchema**](doc//FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**testBodyWithQueryParams**](doc//FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**testClientModel**](doc//FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model

View File

@@ -0,0 +1,3 @@
analyzer:
strong-mode:
implicit-casts: true

View File

@@ -16,6 +16,7 @@ Method | HTTP request | Description
[**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
[**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
[**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
[**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
[**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
[**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
[**testClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
@@ -323,12 +324,54 @@ 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)
# **testBodyWithBinary**
> testBodyWithBinary(body)
For this test, the body has to be a binary file.
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final body = MultipartFile(); // MultipartFile | image to upload
try {
api_instance.testBodyWithBinary(body);
} catch (e) {
print('Exception when calling FakeApi->testBodyWithBinary: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **MultipartFile**| image to upload |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: image/png
- **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)
# **testBodyWithFileSchema**
> testBodyWithFileSchema(fileSchemaTestClass)
For this test, the body for this request much reference a schema named `File`.
For this test, the body for this request must reference a schema named `File`.
### Example
```dart

View File

@@ -43,17 +43,6 @@ class AnotherFakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -29,17 +29,6 @@ class DefaultApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -31,17 +31,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -110,17 +99,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['http_signature_test'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -176,17 +154,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -243,17 +210,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -310,17 +266,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -377,17 +322,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -447,17 +381,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -491,7 +414,59 @@ class FakeApi {
return Future<OuterObjectWithEnumProperty>.value(null);
}
/// For this test, the body for this request much reference a schema named `File`.
/// For this test, the body has to be a binary file.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [MultipartFile] body (required):
/// image to upload
Future<Response> testBodyWithBinaryWithHttpInfo(MultipartFile body) async {
// Verify required params are set.
if (body == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: body');
}
final path = r'/fake/body-with-binary';
Object postBody = body;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['image/png'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
return await apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// For this test, the body has to be a binary file.
///
/// Parameters:
///
/// * [MultipartFile] body (required):
/// image to upload
Future<void> testBodyWithBinary(MultipartFile body) async {
final response = await testBodyWithBinaryWithHttpInfo(body);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// For this test, the body for this request must reference a schema named `File`.
///
/// Note: This method returns the HTTP [Response].
///
@@ -516,17 +491,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -540,7 +504,7 @@ class FakeApi {
);
}
/// For this test, the body for this request much reference a schema named `File`.
/// For this test, the body for this request must reference a schema named `File`.
///
/// Parameters:
///
@@ -581,17 +545,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -645,17 +598,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -767,112 +709,44 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['http_basic_test'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (integer != null) {
hasFields = true;
mp.fields[r'integer'] = parameterToString(integer);
}
if (int32 != null) {
hasFields = true;
mp.fields[r'int32'] = parameterToString(int32);
}
if (int64 != null) {
hasFields = true;
mp.fields[r'int64'] = parameterToString(int64);
}
if (number != null) {
hasFields = true;
mp.fields[r'number'] = parameterToString(number);
}
if (float != null) {
hasFields = true;
mp.fields[r'float'] = parameterToString(float);
}
if (double_ != null) {
hasFields = true;
mp.fields[r'double'] = parameterToString(double_);
}
if (string != null) {
hasFields = true;
mp.fields[r'string'] = parameterToString(string);
}
if (patternWithoutDelimiter != null) {
hasFields = true;
mp.fields[r'pattern_without_delimiter'] = parameterToString(patternWithoutDelimiter);
}
if (byte != null) {
hasFields = true;
mp.fields[r'byte'] = parameterToString(byte);
}
if (binary != null) {
hasFields = true;
mp.fields[r'binary'] = binary.field;
mp.files.add(binary);
}
if (date != null) {
hasFields = true;
mp.fields[r'date'] = parameterToString(date);
}
if (dateTime != null) {
hasFields = true;
mp.fields[r'dateTime'] = parameterToString(dateTime);
}
if (password != null) {
hasFields = true;
mp.fields[r'password'] = parameterToString(password);
}
if (callback != null) {
hasFields = true;
mp.fields[r'callback'] = parameterToString(callback);
}
if (hasFields) {
postBody = mp;
}
} else {
if (integer != null) {
formParams[r'integer'] = parameterToString(integer);
}
if (int32 != null) {
formParams[r'int32'] = parameterToString(int32);
}
if (int64 != null) {
formParams[r'int64'] = parameterToString(int64);
}
if (number != null) {
formParams[r'number'] = parameterToString(number);
}
if (float != null) {
formParams[r'float'] = parameterToString(float);
}
if (double_ != null) {
formParams[r'double'] = parameterToString(double_);
}
if (string != null) {
formParams[r'string'] = parameterToString(string);
}
if (patternWithoutDelimiter != null) {
formParams[r'pattern_without_delimiter'] = parameterToString(patternWithoutDelimiter);
}
if (byte != null) {
formParams[r'byte'] = parameterToString(byte);
}
if (date != null) {
formParams[r'date'] = parameterToString(date);
}
if (dateTime != null) {
formParams[r'dateTime'] = parameterToString(dateTime);
}
if (password != null) {
formParams[r'password'] = parameterToString(password);
}
if (callback != null) {
formParams[r'callback'] = parameterToString(callback);
}
if (integer != null) {
formParams[r'integer'] = parameterToString(integer);
}
if (int32 != null) {
formParams[r'int32'] = parameterToString(int32);
}
if (int64 != null) {
formParams[r'int64'] = parameterToString(int64);
}
if (number != null) {
formParams[r'number'] = parameterToString(number);
}
if (float != null) {
formParams[r'float'] = parameterToString(float);
}
if (double_ != null) {
formParams[r'double'] = parameterToString(double_);
}
if (string != null) {
formParams[r'string'] = parameterToString(string);
}
if (patternWithoutDelimiter != null) {
formParams[r'pattern_without_delimiter'] = parameterToString(patternWithoutDelimiter);
}
if (byte != null) {
formParams[r'byte'] = parameterToString(byte);
}
if (date != null) {
formParams[r'date'] = parameterToString(date);
}
if (dateTime != null) {
formParams[r'dateTime'] = parameterToString(dateTime);
}
if (password != null) {
formParams[r'password'] = parameterToString(password);
}
if (callback != null) {
formParams[r'callback'] = parameterToString(callback);
}
return await apiClient.invokeAPI(
@@ -1007,30 +881,11 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (enumFormStringArray != null) {
hasFields = true;
mp.fields[r'enum_form_string_array'] = parameterToString(enumFormStringArray);
}
if (enumFormString != null) {
hasFields = true;
mp.fields[r'enum_form_string'] = parameterToString(enumFormString);
}
if (hasFields) {
postBody = mp;
}
} else {
if (enumFormStringArray != null) {
formParams[r'enum_form_string_array'] = parameterToString(enumFormStringArray);
}
if (enumFormString != null) {
formParams[r'enum_form_string'] = parameterToString(enumFormString);
}
if (enumFormStringArray != null) {
formParams[r'enum_form_string_array'] = parameterToString(enumFormStringArray);
}
if (enumFormString != null) {
formParams[r'enum_form_string'] = parameterToString(enumFormString);
}
return await apiClient.invokeAPI(
@@ -1144,17 +999,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer_test'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -1224,17 +1068,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -1293,30 +1126,11 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (param != null) {
hasFields = true;
mp.fields[r'param'] = parameterToString(param);
}
if (param2 != null) {
hasFields = true;
mp.fields[r'param2'] = parameterToString(param2);
}
if (hasFields) {
postBody = mp;
}
} else {
if (param != null) {
formParams[r'param'] = parameterToString(param);
}
if (param2 != null) {
formParams[r'param2'] = parameterToString(param2);
}
if (param != null) {
formParams[r'param'] = parameterToString(param);
}
if (param2 != null) {
formParams[r'param2'] = parameterToString(param2);
}
return await apiClient.invokeAPI(
@@ -1388,7 +1202,7 @@ class FakeApi {
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_convertParametersForCollectionFormat('multi', 'pipe', pipe));
queryParams.addAll(_convertParametersForCollectionFormat('pipes', 'pipe', pipe));
queryParams.addAll(_convertParametersForCollectionFormat('csv', 'ioutil', ioutil));
queryParams.addAll(_convertParametersForCollectionFormat('ssv', 'http', http));
queryParams.addAll(_convertParametersForCollectionFormat('csv', 'url', url));
@@ -1398,17 +1212,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -43,17 +43,6 @@ class FakeClassnameTags123Api {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key_query'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -41,17 +41,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -111,17 +100,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -180,17 +158,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -258,17 +225,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -335,17 +291,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -407,17 +352,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -477,30 +411,11 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (name != null) {
hasFields = true;
mp.fields[r'name'] = parameterToString(name);
}
if (status != null) {
hasFields = true;
mp.fields[r'status'] = parameterToString(status);
}
if (hasFields) {
postBody = mp;
}
} else {
if (name != null) {
formParams[r'name'] = parameterToString(name);
}
if (status != null) {
formParams[r'status'] = parameterToString(status);
}
if (name != null) {
formParams[r'name'] = parameterToString(name);
}
if (status != null) {
formParams[r'status'] = parameterToString(status);
}
return await apiClient.invokeAPI(
@@ -567,28 +482,19 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (additionalMetadata != null) {
hasFields = true;
mp.fields[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
if (file != null) {
hasFields = true;
mp.fields[r'file'] = file.field;
mp.files.add(file);
}
if (hasFields) {
postBody = mp;
}
} else {
if (additionalMetadata != null) {
formParams[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
bool hasFields = false;
final mp = MultipartRequest('POST', Uri.parse(path));
if (additionalMetadata != null) {
hasFields = true;
mp.fields[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
if (file != null) {
hasFields = true;
mp.fields[r'file'] = file.field;
mp.files.add(file);
}
if (hasFields) {
postBody = mp;
}
return await apiClient.invokeAPI(
@@ -665,28 +571,19 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (additionalMetadata != null) {
hasFields = true;
mp.fields[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
if (requiredFile != null) {
hasFields = true;
mp.fields[r'requiredFile'] = requiredFile.field;
mp.files.add(requiredFile);
}
if (hasFields) {
postBody = mp;
}
} else {
if (additionalMetadata != null) {
formParams[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
bool hasFields = false;
final mp = MultipartRequest('POST', Uri.parse(path));
if (additionalMetadata != null) {
hasFields = true;
mp.fields[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
if (requiredFile != null) {
hasFields = true;
mp.fields[r'requiredFile'] = requiredFile.field;
mp.files.add(requiredFile);
}
if (hasFields) {
postBody = mp;
}
return await apiClient.invokeAPI(

View File

@@ -44,17 +44,6 @@ class StoreApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -101,17 +90,6 @@ class StoreApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -171,17 +149,6 @@ class StoreApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -243,17 +210,6 @@ class StoreApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -43,17 +43,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -108,17 +97,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -171,17 +149,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -237,17 +204,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -303,17 +259,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -382,17 +327,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -445,17 +379,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -512,17 +435,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -61,7 +61,7 @@ class ApiClient {
Future<Response> invokeAPI(
String path,
String method,
Iterable<QueryParam> queryParams,
List<QueryParam> queryParams,
Object body,
Map<String, String> headerParams,
Map<String, String> formParams,
@@ -171,13 +171,13 @@ class ApiClient {
List<QueryParam> queryParams,
Map<String, String> headerParams,
) {
authNames.forEach((authName) {
for(final authName in authNames) {
final auth = _authentications[authName];
if (auth == null) {
throw ArgumentError('Authentication undefined: $authName');
}
auth.applyToParams(queryParams, headerParams);
});
}
}
static dynamic _deserialize(dynamic value, String targetType, {bool growable}) {

View File

@@ -19,6 +19,7 @@ class ApiException implements Exception {
Exception innerException;
StackTrace stackTrace;
@override
String toString() {
if (message == null) {
return 'ApiException';

View File

@@ -28,7 +28,7 @@ Iterable<QueryParam> _convertParametersForCollectionFormat(
final params = <QueryParam>[];
// preconditions
if (name != null && !name.isEmpty && value != null) {
if (name != null && name.isNotEmpty && value != null) {
if (value is List) {
// get the collection format, default: csv
collectionFormat = (collectionFormat == null || collectionFormat.isEmpty)

View File

@@ -54,18 +54,18 @@ class AdditionalPropertiesClass {
(json[r'map_property'] as Map).cast<String, String>(),
mapOfMapProperty: json[r'map_of_map_property'] == null
? null
: Map.mapFromJson(json[r'map_of_map_property']),
: (json[r'map_of_map_property'] as Map).cast<String, Map>(),
);
static List<AdditionalPropertiesClass> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <AdditionalPropertiesClass>[]
: json.map((v) => AdditionalPropertiesClass.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => AdditionalPropertiesClass.fromJson(value)).toList(growable: true == growable);
static Map<String, AdditionalPropertiesClass> mapFromJson(Map<String, dynamic> json) {
final map = <String, AdditionalPropertiesClass>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = AdditionalPropertiesClass.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = AdditionalPropertiesClass.fromJson(value));
}
return map;
}
@@ -73,9 +73,9 @@ class AdditionalPropertiesClass {
// maps a json object with a list of AdditionalPropertiesClass-objects as value to a dart map
static Map<String, List<AdditionalPropertiesClass>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<AdditionalPropertiesClass>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = AdditionalPropertiesClass.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = AdditionalPropertiesClass.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -54,12 +54,12 @@ class Animal {
static List<Animal> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Animal>[]
: json.map((v) => Animal.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Animal.fromJson(value)).toList(growable: true == growable);
static Map<String, Animal> mapFromJson(Map<String, dynamic> json) {
final map = <String, Animal>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Animal.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Animal.fromJson(value));
}
return map;
}
@@ -67,9 +67,9 @@ class Animal {
// maps a json object with a list of Animal-objects as value to a dart map
static Map<String, List<Animal>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Animal>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Animal.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Animal.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -65,12 +65,12 @@ class ApiResponse {
static List<ApiResponse> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ApiResponse>[]
: json.map((v) => ApiResponse.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => ApiResponse.fromJson(value)).toList(growable: true == growable);
static Map<String, ApiResponse> mapFromJson(Map<String, dynamic> json) {
final map = <String, ApiResponse>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ApiResponse.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = ApiResponse.fromJson(value));
}
return map;
}
@@ -78,9 +78,9 @@ class ApiResponse {
// maps a json object with a list of ApiResponse-objects as value to a dart map
static Map<String, List<ApiResponse>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ApiResponse>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ApiResponse.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = ApiResponse.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -51,12 +51,12 @@ class ArrayOfArrayOfNumberOnly {
static List<ArrayOfArrayOfNumberOnly> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ArrayOfArrayOfNumberOnly>[]
: json.map((v) => ArrayOfArrayOfNumberOnly.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => ArrayOfArrayOfNumberOnly.fromJson(value)).toList(growable: true == growable);
static Map<String, ArrayOfArrayOfNumberOnly> mapFromJson(Map<String, dynamic> json) {
final map = <String, ArrayOfArrayOfNumberOnly>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ArrayOfArrayOfNumberOnly.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = ArrayOfArrayOfNumberOnly.fromJson(value));
}
return map;
}
@@ -64,9 +64,9 @@ class ArrayOfArrayOfNumberOnly {
// maps a json object with a list of ArrayOfArrayOfNumberOnly-objects as value to a dart map
static Map<String, List<ArrayOfArrayOfNumberOnly>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ArrayOfArrayOfNumberOnly>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ArrayOfArrayOfNumberOnly.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = ArrayOfArrayOfNumberOnly.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -49,12 +49,12 @@ class ArrayOfNumberOnly {
static List<ArrayOfNumberOnly> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ArrayOfNumberOnly>[]
: json.map((v) => ArrayOfNumberOnly.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => ArrayOfNumberOnly.fromJson(value)).toList(growable: true == growable);
static Map<String, ArrayOfNumberOnly> mapFromJson(Map<String, dynamic> json) {
final map = <String, ArrayOfNumberOnly>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ArrayOfNumberOnly.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = ArrayOfNumberOnly.fromJson(value));
}
return map;
}
@@ -62,9 +62,9 @@ class ArrayOfNumberOnly {
// maps a json object with a list of ArrayOfNumberOnly-objects as value to a dart map
static Map<String, List<ArrayOfNumberOnly>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ArrayOfNumberOnly>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ArrayOfNumberOnly.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = ArrayOfNumberOnly.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -75,12 +75,12 @@ class ArrayTest {
static List<ArrayTest> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ArrayTest>[]
: json.map((v) => ArrayTest.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => ArrayTest.fromJson(value)).toList(growable: true == growable);
static Map<String, ArrayTest> mapFromJson(Map<String, dynamic> json) {
final map = <String, ArrayTest>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ArrayTest.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = ArrayTest.fromJson(value));
}
return map;
}
@@ -88,9 +88,9 @@ class ArrayTest {
// maps a json object with a list of ArrayTest-objects as value to a dart map
static Map<String, List<ArrayTest>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ArrayTest>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ArrayTest.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = ArrayTest.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -93,12 +93,12 @@ class Capitalization {
static List<Capitalization> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Capitalization>[]
: json.map((v) => Capitalization.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Capitalization.fromJson(value)).toList(growable: true == growable);
static Map<String, Capitalization> mapFromJson(Map<String, dynamic> json) {
final map = <String, Capitalization>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Capitalization.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Capitalization.fromJson(value));
}
return map;
}
@@ -106,9 +106,9 @@ class Capitalization {
// maps a json object with a list of Capitalization-objects as value to a dart map
static Map<String, List<Capitalization>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Capitalization>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Capitalization.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Capitalization.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -63,12 +63,12 @@ class Cat {
static List<Cat> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Cat>[]
: json.map((v) => Cat.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Cat.fromJson(value)).toList(growable: true == growable);
static Map<String, Cat> mapFromJson(Map<String, dynamic> json) {
final map = <String, Cat>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Cat.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Cat.fromJson(value));
}
return map;
}
@@ -76,9 +76,9 @@ class Cat {
// maps a json object with a list of Cat-objects as value to a dart map
static Map<String, List<Cat>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Cat>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Cat.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Cat.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -47,12 +47,12 @@ class CatAllOf {
static List<CatAllOf> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <CatAllOf>[]
: json.map((v) => CatAllOf.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => CatAllOf.fromJson(value)).toList(growable: true == growable);
static Map<String, CatAllOf> mapFromJson(Map<String, dynamic> json) {
final map = <String, CatAllOf>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = CatAllOf.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = CatAllOf.fromJson(value));
}
return map;
}
@@ -60,9 +60,9 @@ class CatAllOf {
// maps a json object with a list of CatAllOf-objects as value to a dart map
static Map<String, List<CatAllOf>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<CatAllOf>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = CatAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = CatAllOf.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -54,12 +54,12 @@ class Category {
static List<Category> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Category>[]
: json.map((v) => Category.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Category.fromJson(value)).toList(growable: true == growable);
static Map<String, Category> mapFromJson(Map<String, dynamic> json) {
final map = <String, Category>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Category.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Category.fromJson(value));
}
return map;
}
@@ -67,9 +67,9 @@ class Category {
// maps a json object with a list of Category-objects as value to a dart map
static Map<String, List<Category>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Category>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Category.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Category.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -47,12 +47,12 @@ class ClassModel {
static List<ClassModel> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ClassModel>[]
: json.map((v) => ClassModel.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => ClassModel.fromJson(value)).toList(growable: true == growable);
static Map<String, ClassModel> mapFromJson(Map<String, dynamic> json) {
final map = <String, ClassModel>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ClassModel.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = ClassModel.fromJson(value));
}
return map;
}
@@ -60,9 +60,9 @@ class ClassModel {
// maps a json object with a list of ClassModel-objects as value to a dart map
static Map<String, List<ClassModel>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ClassModel>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ClassModel.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = ClassModel.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -63,12 +63,12 @@ class Dog {
static List<Dog> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Dog>[]
: json.map((v) => Dog.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Dog.fromJson(value)).toList(growable: true == growable);
static Map<String, Dog> mapFromJson(Map<String, dynamic> json) {
final map = <String, Dog>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Dog.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Dog.fromJson(value));
}
return map;
}
@@ -76,9 +76,9 @@ class Dog {
// maps a json object with a list of Dog-objects as value to a dart map
static Map<String, List<Dog>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Dog>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Dog.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Dog.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -47,12 +47,12 @@ class DogAllOf {
static List<DogAllOf> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <DogAllOf>[]
: json.map((v) => DogAllOf.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => DogAllOf.fromJson(value)).toList(growable: true == growable);
static Map<String, DogAllOf> mapFromJson(Map<String, dynamic> json) {
final map = <String, DogAllOf>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = DogAllOf.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = DogAllOf.fromJson(value));
}
return map;
}
@@ -60,9 +60,9 @@ class DogAllOf {
// maps a json object with a list of DogAllOf-objects as value to a dart map
static Map<String, List<DogAllOf>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<DogAllOf>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = DogAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = DogAllOf.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -56,12 +56,12 @@ class EnumArrays {
static List<EnumArrays> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <EnumArrays>[]
: json.map((v) => EnumArrays.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => EnumArrays.fromJson(value)).toList(growable: true == growable);
static Map<String, EnumArrays> mapFromJson(Map<String, dynamic> json) {
final map = <String, EnumArrays>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = EnumArrays.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = EnumArrays.fromJson(value));
}
return map;
}
@@ -69,9 +69,9 @@ class EnumArrays {
// maps a json object with a list of EnumArrays-objects as value to a dart map
static Map<String, List<EnumArrays>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<EnumArrays>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = EnumArrays.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = EnumArrays.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -108,12 +108,12 @@ class EnumTest {
static List<EnumTest> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <EnumTest>[]
: json.map((v) => EnumTest.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => EnumTest.fromJson(value)).toList(growable: true == growable);
static Map<String, EnumTest> mapFromJson(Map<String, dynamic> json) {
final map = <String, EnumTest>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = EnumTest.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = EnumTest.fromJson(value));
}
return map;
}
@@ -121,9 +121,9 @@ class EnumTest {
// maps a json object with a list of EnumTest-objects as value to a dart map
static Map<String, List<EnumTest>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<EnumTest>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = EnumTest.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = EnumTest.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -56,12 +56,12 @@ class FileSchemaTestClass {
static List<FileSchemaTestClass> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <FileSchemaTestClass>[]
: json.map((v) => FileSchemaTestClass.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => FileSchemaTestClass.fromJson(value)).toList(growable: true == growable);
static Map<String, FileSchemaTestClass> mapFromJson(Map<String, dynamic> json) {
final map = <String, FileSchemaTestClass>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = FileSchemaTestClass.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = FileSchemaTestClass.fromJson(value));
}
return map;
}
@@ -69,9 +69,9 @@ class FileSchemaTestClass {
// maps a json object with a list of FileSchemaTestClass-objects as value to a dart map
static Map<String, List<FileSchemaTestClass>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<FileSchemaTestClass>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = FileSchemaTestClass.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = FileSchemaTestClass.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -47,12 +47,12 @@ class Foo {
static List<Foo> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Foo>[]
: json.map((v) => Foo.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Foo.fromJson(value)).toList(growable: true == growable);
static Map<String, Foo> mapFromJson(Map<String, dynamic> json) {
final map = <String, Foo>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Foo.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Foo.fromJson(value));
}
return map;
}
@@ -60,9 +60,9 @@ class Foo {
// maps a json object with a list of Foo-objects as value to a dart map
static Map<String, List<Foo>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Foo>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Foo.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Foo.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -192,12 +192,12 @@ class FormatTest {
static List<FormatTest> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <FormatTest>[]
: json.map((v) => FormatTest.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => FormatTest.fromJson(value)).toList(growable: true == growable);
static Map<String, FormatTest> mapFromJson(Map<String, dynamic> json) {
final map = <String, FormatTest>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = FormatTest.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = FormatTest.fromJson(value));
}
return map;
}
@@ -205,9 +205,9 @@ class FormatTest {
// maps a json object with a list of FormatTest-objects as value to a dart map
static Map<String, List<FormatTest>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<FormatTest>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = FormatTest.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = FormatTest.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -56,12 +56,12 @@ class HasOnlyReadOnly {
static List<HasOnlyReadOnly> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <HasOnlyReadOnly>[]
: json.map((v) => HasOnlyReadOnly.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => HasOnlyReadOnly.fromJson(value)).toList(growable: true == growable);
static Map<String, HasOnlyReadOnly> mapFromJson(Map<String, dynamic> json) {
final map = <String, HasOnlyReadOnly>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = HasOnlyReadOnly.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = HasOnlyReadOnly.fromJson(value));
}
return map;
}
@@ -69,9 +69,9 @@ class HasOnlyReadOnly {
// maps a json object with a list of HasOnlyReadOnly-objects as value to a dart map
static Map<String, List<HasOnlyReadOnly>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<HasOnlyReadOnly>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = HasOnlyReadOnly.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = HasOnlyReadOnly.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -47,12 +47,12 @@ class HealthCheckResult {
static List<HealthCheckResult> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <HealthCheckResult>[]
: json.map((v) => HealthCheckResult.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => HealthCheckResult.fromJson(value)).toList(growable: true == growable);
static Map<String, HealthCheckResult> mapFromJson(Map<String, dynamic> json) {
final map = <String, HealthCheckResult>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = HealthCheckResult.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = HealthCheckResult.fromJson(value));
}
return map;
}
@@ -60,9 +60,9 @@ class HealthCheckResult {
// maps a json object with a list of HealthCheckResult-objects as value to a dart map
static Map<String, List<HealthCheckResult>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<HealthCheckResult>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = HealthCheckResult.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = HealthCheckResult.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -47,12 +47,12 @@ class InlineResponseDefault {
static List<InlineResponseDefault> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <InlineResponseDefault>[]
: json.map((v) => InlineResponseDefault.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => InlineResponseDefault.fromJson(value)).toList(growable: true == growable);
static Map<String, InlineResponseDefault> mapFromJson(Map<String, dynamic> json) {
final map = <String, InlineResponseDefault>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = InlineResponseDefault.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = InlineResponseDefault.fromJson(value));
}
return map;
}
@@ -60,9 +60,9 @@ class InlineResponseDefault {
// maps a json object with a list of InlineResponseDefault-objects as value to a dart map
static Map<String, List<InlineResponseDefault>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<InlineResponseDefault>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = InlineResponseDefault.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = InlineResponseDefault.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -67,7 +67,7 @@ class MapTest {
: MapTest(
mapMapOfString: json[r'map_map_of_string'] == null
? null
: Map.mapFromJson(json[r'map_map_of_string']),
: (json[r'map_map_of_string'] as Map).cast<String, Map>(),
mapOfEnumString: json[r'map_of_enum_string'] == null ?
null :
(json[r'map_of_enum_string'] as Map).cast<String, String>(),
@@ -82,12 +82,12 @@ class MapTest {
static List<MapTest> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <MapTest>[]
: json.map((v) => MapTest.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => MapTest.fromJson(value)).toList(growable: true == growable);
static Map<String, MapTest> mapFromJson(Map<String, dynamic> json) {
final map = <String, MapTest>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = MapTest.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = MapTest.fromJson(value));
}
return map;
}
@@ -95,9 +95,9 @@ class MapTest {
// maps a json object with a list of MapTest-objects as value to a dart map
static Map<String, List<MapTest>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<MapTest>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = MapTest.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = MapTest.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -61,20 +61,18 @@ class MixedPropertiesAndAdditionalPropertiesClass {
dateTime: json[r'dateTime'] == null
? null
: DateTime.parse(json[r'dateTime']),
map: json[r'map'] == null
? null
: Animal.mapFromJson(json[r'map']),
map: json[r'map']
);
static List<MixedPropertiesAndAdditionalPropertiesClass> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <MixedPropertiesAndAdditionalPropertiesClass>[]
: json.map((v) => MixedPropertiesAndAdditionalPropertiesClass.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => MixedPropertiesAndAdditionalPropertiesClass.fromJson(value)).toList(growable: true == growable);
static Map<String, MixedPropertiesAndAdditionalPropertiesClass> mapFromJson(Map<String, dynamic> json) {
final map = <String, MixedPropertiesAndAdditionalPropertiesClass>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = MixedPropertiesAndAdditionalPropertiesClass.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = MixedPropertiesAndAdditionalPropertiesClass.fromJson(value));
}
return map;
}
@@ -82,9 +80,9 @@ class MixedPropertiesAndAdditionalPropertiesClass {
// maps a json object with a list of MixedPropertiesAndAdditionalPropertiesClass-objects as value to a dart map
static Map<String, List<MixedPropertiesAndAdditionalPropertiesClass>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<MixedPropertiesAndAdditionalPropertiesClass>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = MixedPropertiesAndAdditionalPropertiesClass.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = MixedPropertiesAndAdditionalPropertiesClass.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -56,12 +56,12 @@ class Model200Response {
static List<Model200Response> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Model200Response>[]
: json.map((v) => Model200Response.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Model200Response.fromJson(value)).toList(growable: true == growable);
static Map<String, Model200Response> mapFromJson(Map<String, dynamic> json) {
final map = <String, Model200Response>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Model200Response.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Model200Response.fromJson(value));
}
return map;
}
@@ -69,9 +69,9 @@ class Model200Response {
// maps a json object with a list of Model200Response-objects as value to a dart map
static Map<String, List<Model200Response>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Model200Response>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Model200Response.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Model200Response.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -47,12 +47,12 @@ class ModelClient {
static List<ModelClient> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ModelClient>[]
: json.map((v) => ModelClient.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => ModelClient.fromJson(value)).toList(growable: true == growable);
static Map<String, ModelClient> mapFromJson(Map<String, dynamic> json) {
final map = <String, ModelClient>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ModelClient.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = ModelClient.fromJson(value));
}
return map;
}
@@ -60,9 +60,9 @@ class ModelClient {
// maps a json object with a list of ModelClient-objects as value to a dart map
static Map<String, List<ModelClient>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ModelClient>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ModelClient.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = ModelClient.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -48,12 +48,12 @@ class ModelFile {
static List<ModelFile> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ModelFile>[]
: json.map((v) => ModelFile.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => ModelFile.fromJson(value)).toList(growable: true == growable);
static Map<String, ModelFile> mapFromJson(Map<String, dynamic> json) {
final map = <String, ModelFile>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ModelFile.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = ModelFile.fromJson(value));
}
return map;
}
@@ -61,9 +61,9 @@ class ModelFile {
// maps a json object with a list of ModelFile-objects as value to a dart map
static Map<String, List<ModelFile>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ModelFile>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ModelFile.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = ModelFile.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -47,12 +47,12 @@ class ModelList {
static List<ModelList> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ModelList>[]
: json.map((v) => ModelList.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => ModelList.fromJson(value)).toList(growable: true == growable);
static Map<String, ModelList> mapFromJson(Map<String, dynamic> json) {
final map = <String, ModelList>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ModelList.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = ModelList.fromJson(value));
}
return map;
}
@@ -60,9 +60,9 @@ class ModelList {
// maps a json object with a list of ModelList-objects as value to a dart map
static Map<String, List<ModelList>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ModelList>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ModelList.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = ModelList.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -47,12 +47,12 @@ class ModelReturn {
static List<ModelReturn> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ModelReturn>[]
: json.map((v) => ModelReturn.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => ModelReturn.fromJson(value)).toList(growable: true == growable);
static Map<String, ModelReturn> mapFromJson(Map<String, dynamic> json) {
final map = <String, ModelReturn>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ModelReturn.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = ModelReturn.fromJson(value));
}
return map;
}
@@ -60,9 +60,9 @@ class ModelReturn {
// maps a json object with a list of ModelReturn-objects as value to a dart map
static Map<String, List<ModelReturn>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ModelReturn>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ModelReturn.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = ModelReturn.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -72,12 +72,12 @@ class Name {
static List<Name> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Name>[]
: json.map((v) => Name.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Name.fromJson(value)).toList(growable: true == growable);
static Map<String, Name> mapFromJson(Map<String, dynamic> json) {
final map = <String, Name>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Name.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Name.fromJson(value));
}
return map;
}
@@ -85,9 +85,9 @@ class Name {
// maps a json object with a list of Name-objects as value to a dart map
static Map<String, List<Name>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Name>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Name.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Name.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -144,26 +144,20 @@ class NullableClass {
arrayNullableProp: Object.listFromJson(json[r'array_nullable_prop']),
arrayAndItemsNullableProp: Object.listFromJson(json[r'array_and_items_nullable_prop']),
arrayItemsNullable: Object.listFromJson(json[r'array_items_nullable']),
objectNullableProp: json[r'object_nullable_prop'] == null
? null
: Object.mapFromJson(json[r'object_nullable_prop']),
objectAndItemsNullableProp: json[r'object_and_items_nullable_prop'] == null
? null
: Object.mapFromJson(json[r'object_and_items_nullable_prop']),
objectItemsNullable: json[r'object_items_nullable'] == null
? null
: Object.mapFromJson(json[r'object_items_nullable']),
objectNullableProp: json[r'object_nullable_prop']
objectAndItemsNullableProp: json[r'object_and_items_nullable_prop']
objectItemsNullable: json[r'object_items_nullable']
);
static List<NullableClass> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <NullableClass>[]
: json.map((v) => NullableClass.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => NullableClass.fromJson(value)).toList(growable: true == growable);
static Map<String, NullableClass> mapFromJson(Map<String, dynamic> json) {
final map = <String, NullableClass>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = NullableClass.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = NullableClass.fromJson(value));
}
return map;
}
@@ -171,9 +165,9 @@ class NullableClass {
// maps a json object with a list of NullableClass-objects as value to a dart map
static Map<String, List<NullableClass>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<NullableClass>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = NullableClass.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = NullableClass.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -49,12 +49,12 @@ class NumberOnly {
static List<NumberOnly> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <NumberOnly>[]
: json.map((v) => NumberOnly.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => NumberOnly.fromJson(value)).toList(growable: true == growable);
static Map<String, NumberOnly> mapFromJson(Map<String, dynamic> json) {
final map = <String, NumberOnly>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = NumberOnly.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = NumberOnly.fromJson(value));
}
return map;
}
@@ -62,9 +62,9 @@ class NumberOnly {
// maps a json object with a list of NumberOnly-objects as value to a dart map
static Map<String, List<NumberOnly>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<NumberOnly>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = NumberOnly.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = NumberOnly.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -95,12 +95,12 @@ class Order {
static List<Order> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Order>[]
: json.map((v) => Order.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Order.fromJson(value)).toList(growable: true == growable);
static Map<String, Order> mapFromJson(Map<String, dynamic> json) {
final map = <String, Order>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Order.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Order.fromJson(value));
}
return map;
}
@@ -108,9 +108,9 @@ class Order {
// maps a json object with a list of Order-objects as value to a dart map
static Map<String, List<Order>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Order>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Order.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Order.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -67,12 +67,12 @@ class OuterComposite {
static List<OuterComposite> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <OuterComposite>[]
: json.map((v) => OuterComposite.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => OuterComposite.fromJson(value)).toList(growable: true == growable);
static Map<String, OuterComposite> mapFromJson(Map<String, dynamic> json) {
final map = <String, OuterComposite>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = OuterComposite.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = OuterComposite.fromJson(value));
}
return map;
}
@@ -80,9 +80,9 @@ class OuterComposite {
// maps a json object with a list of OuterComposite-objects as value to a dart map
static Map<String, List<OuterComposite>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<OuterComposite>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = OuterComposite.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = OuterComposite.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -45,12 +45,12 @@ class OuterObjectWithEnumProperty {
static List<OuterObjectWithEnumProperty> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <OuterObjectWithEnumProperty>[]
: json.map((v) => OuterObjectWithEnumProperty.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => OuterObjectWithEnumProperty.fromJson(value)).toList(growable: true == growable);
static Map<String, OuterObjectWithEnumProperty> mapFromJson(Map<String, dynamic> json) {
final map = <String, OuterObjectWithEnumProperty>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = OuterObjectWithEnumProperty.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = OuterObjectWithEnumProperty.fromJson(value));
}
return map;
}
@@ -58,9 +58,9 @@ class OuterObjectWithEnumProperty {
// maps a json object with a list of OuterObjectWithEnumProperty-objects as value to a dart map
static Map<String, List<OuterObjectWithEnumProperty>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<OuterObjectWithEnumProperty>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = OuterObjectWithEnumProperty.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = OuterObjectWithEnumProperty.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -91,12 +91,12 @@ class Pet {
static List<Pet> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Pet>[]
: json.map((v) => Pet.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Pet.fromJson(value)).toList(growable: true == growable);
static Map<String, Pet> mapFromJson(Map<String, dynamic> json) {
final map = <String, Pet>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Pet.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Pet.fromJson(value));
}
return map;
}
@@ -104,9 +104,9 @@ class Pet {
// maps a json object with a list of Pet-objects as value to a dart map
static Map<String, List<Pet>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Pet>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Pet.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Pet.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -56,12 +56,12 @@ class ReadOnlyFirst {
static List<ReadOnlyFirst> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ReadOnlyFirst>[]
: json.map((v) => ReadOnlyFirst.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => ReadOnlyFirst.fromJson(value)).toList(growable: true == growable);
static Map<String, ReadOnlyFirst> mapFromJson(Map<String, dynamic> json) {
final map = <String, ReadOnlyFirst>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ReadOnlyFirst.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = ReadOnlyFirst.fromJson(value));
}
return map;
}
@@ -69,9 +69,9 @@ class ReadOnlyFirst {
// maps a json object with a list of ReadOnlyFirst-objects as value to a dart map
static Map<String, List<ReadOnlyFirst>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<ReadOnlyFirst>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ReadOnlyFirst.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = ReadOnlyFirst.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -47,12 +47,12 @@ class SpecialModelName {
static List<SpecialModelName> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <SpecialModelName>[]
: json.map((v) => SpecialModelName.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => SpecialModelName.fromJson(value)).toList(growable: true == growable);
static Map<String, SpecialModelName> mapFromJson(Map<String, dynamic> json) {
final map = <String, SpecialModelName>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = SpecialModelName.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = SpecialModelName.fromJson(value));
}
return map;
}
@@ -60,9 +60,9 @@ class SpecialModelName {
// maps a json object with a list of SpecialModelName-objects as value to a dart map
static Map<String, List<SpecialModelName>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<SpecialModelName>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = SpecialModelName.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = SpecialModelName.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -56,12 +56,12 @@ class Tag {
static List<Tag> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <Tag>[]
: json.map((v) => Tag.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => Tag.fromJson(value)).toList(growable: true == growable);
static Map<String, Tag> mapFromJson(Map<String, dynamic> json) {
final map = <String, Tag>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = Tag.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = Tag.fromJson(value));
}
return map;
}
@@ -69,9 +69,9 @@ class Tag {
// maps a json object with a list of Tag-objects as value to a dart map
static Map<String, List<Tag>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<Tag>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = Tag.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = Tag.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -111,12 +111,12 @@ class User {
static List<User> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <User>[]
: json.map((v) => User.fromJson(v)).toList(growable: true == growable);
: json.map((dynamic value) => User.fromJson(value)).toList(growable: true == growable);
static Map<String, User> mapFromJson(Map<String, dynamic> json) {
final map = <String, User>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = User.fromJson(v));
if (json?.isNotEmpty == true) {
json.forEach((key, value) => map[key] = User.fromJson(value));
}
return map;
}
@@ -124,9 +124,9 @@ class User {
// maps a json object with a list of User-objects as value to a dart map
static Map<String, List<User>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
final map = <String, List<User>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = User.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
if (json?.isNotEmpty == true) {
json.forEach((key, value) {
map[key] = User.listFromJson(value, emptyIsNull: emptyIsNull, growable: growable,);
});
}
return map;

View File

@@ -5,8 +5,6 @@
name: 'openapi'
version: '1.0.0'
description: 'OpenAPI API client'
authors:
- 'Author <author@homepage>'
homepage: 'homepage'
environment:
sdk: '>=2.12.0 <3.0.0'

View File

@@ -1,6 +1,7 @@
.gitignore
.travis.yml
README.md
analysis_options.yaml
build.yaml
doc/AdditionalPropertiesClass.md
doc/Animal.md

View File

@@ -1 +1,5 @@
6.0.0-SNAPSHOT
<<<<<<< HEAD
6.0.0-SNAPSHOT
=======
5.3.0-SNAPSHOT
>>>>>>> origin/5.3.x

View File

@@ -67,6 +67,7 @@ Class | Method | HTTP request | Description
*FakeApi* | [**fakeOuterNumberSerialize**](doc//FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
*FakeApi* | [**fakeOuterStringSerialize**](doc//FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
*FakeApi* | [**fakePropertyEnumIntegerSerialize**](doc//FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
*FakeApi* | [**testBodyWithBinary**](doc//FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
*FakeApi* | [**testBodyWithFileSchema**](doc//FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
*FakeApi* | [**testBodyWithQueryParams**](doc//FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**testClientModel**](doc//FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model

View File

@@ -0,0 +1,3 @@
analyzer:
strong-mode:
implicit-casts: true

View File

@@ -16,6 +16,7 @@ Method | HTTP request | Description
[**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
[**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
[**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int |
[**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary |
[**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
[**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
[**testClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
@@ -323,12 +324,54 @@ 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)
# **testBodyWithBinary**
> testBodyWithBinary(body)
For this test, the body has to be a binary file.
### Example
```dart
import 'package:openapi/api.dart';
final api_instance = FakeApi();
final body = MultipartFile(); // MultipartFile | image to upload
try {
api_instance.testBodyWithBinary(body);
} catch (e) {
print('Exception when calling FakeApi->testBodyWithBinary: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **MultipartFile**| image to upload |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: image/png
- **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)
# **testBodyWithFileSchema**
> testBodyWithFileSchema(fileSchemaTestClass)
For this test, the body for this request much reference a schema named `File`.
For this test, the body for this request must reference a schema named `File`.
### Example
```dart

View File

@@ -43,17 +43,6 @@ class AnotherFakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -29,17 +29,6 @@ class DefaultApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -31,17 +31,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -111,17 +100,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['http_signature_test'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -177,17 +155,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -245,17 +212,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -313,17 +269,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -381,17 +326,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -452,17 +386,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -497,7 +420,59 @@ class FakeApi {
return Future<OuterObjectWithEnumProperty>.value(null);
}
/// For this test, the body for this request much reference a schema named `File`.
/// For this test, the body has to be a binary file.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [MultipartFile] body (required):
/// image to upload
Future<Response> testBodyWithBinaryWithHttpInfo(MultipartFile body) async {
// Verify required params are set.
if (body == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: body');
}
final path = r'/fake/body-with-binary';
Object postBody = body;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['image/png'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
return await apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
);
}
/// For this test, the body has to be a binary file.
///
/// Parameters:
///
/// * [MultipartFile] body (required):
/// image to upload
Future<void> testBodyWithBinary(MultipartFile body) async {
final response = await testBodyWithBinaryWithHttpInfo(body);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// For this test, the body for this request must reference a schema named `File`.
///
/// Note: This method returns the HTTP [Response].
///
@@ -522,17 +497,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -546,7 +510,7 @@ class FakeApi {
);
}
/// For this test, the body for this request much reference a schema named `File`.
/// For this test, the body for this request must reference a schema named `File`.
///
/// Parameters:
///
@@ -587,17 +551,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -651,17 +604,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -774,112 +716,44 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['http_basic_test'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (integer != null) {
hasFields = true;
mp.fields[r'integer'] = parameterToString(integer);
}
if (int32 != null) {
hasFields = true;
mp.fields[r'int32'] = parameterToString(int32);
}
if (int64 != null) {
hasFields = true;
mp.fields[r'int64'] = parameterToString(int64);
}
if (number != null) {
hasFields = true;
mp.fields[r'number'] = parameterToString(number);
}
if (float != null) {
hasFields = true;
mp.fields[r'float'] = parameterToString(float);
}
if (double_ != null) {
hasFields = true;
mp.fields[r'double'] = parameterToString(double_);
}
if (string != null) {
hasFields = true;
mp.fields[r'string'] = parameterToString(string);
}
if (patternWithoutDelimiter != null) {
hasFields = true;
mp.fields[r'pattern_without_delimiter'] = parameterToString(patternWithoutDelimiter);
}
if (byte != null) {
hasFields = true;
mp.fields[r'byte'] = parameterToString(byte);
}
if (binary != null) {
hasFields = true;
mp.fields[r'binary'] = binary.field;
mp.files.add(binary);
}
if (date != null) {
hasFields = true;
mp.fields[r'date'] = parameterToString(date);
}
if (dateTime != null) {
hasFields = true;
mp.fields[r'dateTime'] = parameterToString(dateTime);
}
if (password != null) {
hasFields = true;
mp.fields[r'password'] = parameterToString(password);
}
if (callback != null) {
hasFields = true;
mp.fields[r'callback'] = parameterToString(callback);
}
if (hasFields) {
postBody = mp;
}
} else {
if (integer != null) {
formParams[r'integer'] = parameterToString(integer);
}
if (int32 != null) {
formParams[r'int32'] = parameterToString(int32);
}
if (int64 != null) {
formParams[r'int64'] = parameterToString(int64);
}
if (number != null) {
formParams[r'number'] = parameterToString(number);
}
if (float != null) {
formParams[r'float'] = parameterToString(float);
}
if (double_ != null) {
formParams[r'double'] = parameterToString(double_);
}
if (string != null) {
formParams[r'string'] = parameterToString(string);
}
if (patternWithoutDelimiter != null) {
formParams[r'pattern_without_delimiter'] = parameterToString(patternWithoutDelimiter);
}
if (byte != null) {
formParams[r'byte'] = parameterToString(byte);
}
if (date != null) {
formParams[r'date'] = parameterToString(date);
}
if (dateTime != null) {
formParams[r'dateTime'] = parameterToString(dateTime);
}
if (password != null) {
formParams[r'password'] = parameterToString(password);
}
if (callback != null) {
formParams[r'callback'] = parameterToString(callback);
}
if (integer != null) {
formParams[r'integer'] = parameterToString(integer);
}
if (int32 != null) {
formParams[r'int32'] = parameterToString(int32);
}
if (int64 != null) {
formParams[r'int64'] = parameterToString(int64);
}
if (number != null) {
formParams[r'number'] = parameterToString(number);
}
if (float != null) {
formParams[r'float'] = parameterToString(float);
}
if (double_ != null) {
formParams[r'double'] = parameterToString(double_);
}
if (string != null) {
formParams[r'string'] = parameterToString(string);
}
if (patternWithoutDelimiter != null) {
formParams[r'pattern_without_delimiter'] = parameterToString(patternWithoutDelimiter);
}
if (byte != null) {
formParams[r'byte'] = parameterToString(byte);
}
if (date != null) {
formParams[r'date'] = parameterToString(date);
}
if (dateTime != null) {
formParams[r'dateTime'] = parameterToString(dateTime);
}
if (password != null) {
formParams[r'password'] = parameterToString(password);
}
if (callback != null) {
formParams[r'callback'] = parameterToString(callback);
}
return await apiClient.invokeAPI(
@@ -1014,30 +888,11 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (enumFormStringArray != null) {
hasFields = true;
mp.fields[r'enum_form_string_array'] = parameterToString(enumFormStringArray);
}
if (enumFormString != null) {
hasFields = true;
mp.fields[r'enum_form_string'] = parameterToString(enumFormString);
}
if (hasFields) {
postBody = mp;
}
} else {
if (enumFormStringArray != null) {
formParams[r'enum_form_string_array'] = parameterToString(enumFormStringArray);
}
if (enumFormString != null) {
formParams[r'enum_form_string'] = parameterToString(enumFormString);
}
if (enumFormStringArray != null) {
formParams[r'enum_form_string_array'] = parameterToString(enumFormStringArray);
}
if (enumFormString != null) {
formParams[r'enum_form_string'] = parameterToString(enumFormString);
}
return await apiClient.invokeAPI(
@@ -1151,17 +1006,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer_test'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -1231,17 +1075,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -1300,30 +1133,11 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (param != null) {
hasFields = true;
mp.fields[r'param'] = parameterToString(param);
}
if (param2 != null) {
hasFields = true;
mp.fields[r'param2'] = parameterToString(param2);
}
if (hasFields) {
postBody = mp;
}
} else {
if (param != null) {
formParams[r'param'] = parameterToString(param);
}
if (param2 != null) {
formParams[r'param2'] = parameterToString(param2);
}
if (param != null) {
formParams[r'param'] = parameterToString(param);
}
if (param2 != null) {
formParams[r'param2'] = parameterToString(param2);
}
return await apiClient.invokeAPI(
@@ -1395,7 +1209,7 @@ class FakeApi {
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_convertParametersForCollectionFormat('multi', 'pipe', pipe));
queryParams.addAll(_convertParametersForCollectionFormat('pipes', 'pipe', pipe));
queryParams.addAll(_convertParametersForCollectionFormat('csv', 'ioutil', ioutil));
queryParams.addAll(_convertParametersForCollectionFormat('ssv', 'http', http));
queryParams.addAll(_convertParametersForCollectionFormat('csv', 'url', url));
@@ -1405,17 +1219,6 @@ class FakeApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -43,17 +43,6 @@ class FakeClassnameTags123Api {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key_query'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -41,17 +41,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -111,17 +100,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -180,17 +158,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -259,17 +226,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -337,17 +293,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -410,17 +355,6 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -480,30 +414,11 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (name != null) {
hasFields = true;
mp.fields[r'name'] = parameterToString(name);
}
if (status != null) {
hasFields = true;
mp.fields[r'status'] = parameterToString(status);
}
if (hasFields) {
postBody = mp;
}
} else {
if (name != null) {
formParams[r'name'] = parameterToString(name);
}
if (status != null) {
formParams[r'status'] = parameterToString(status);
}
if (name != null) {
formParams[r'name'] = parameterToString(name);
}
if (status != null) {
formParams[r'status'] = parameterToString(status);
}
return await apiClient.invokeAPI(
@@ -570,28 +485,19 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (additionalMetadata != null) {
hasFields = true;
mp.fields[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
if (file != null) {
hasFields = true;
mp.fields[r'file'] = file.field;
mp.files.add(file);
}
if (hasFields) {
postBody = mp;
}
} else {
if (additionalMetadata != null) {
formParams[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
bool hasFields = false;
final mp = MultipartRequest('POST', Uri.parse(path));
if (additionalMetadata != null) {
hasFields = true;
mp.fields[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
if (file != null) {
hasFields = true;
mp.fields[r'file'] = file.field;
mp.files.add(file);
}
if (hasFields) {
postBody = mp;
}
return await apiClient.invokeAPI(
@@ -669,28 +575,19 @@ class PetApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['petstore_auth'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (additionalMetadata != null) {
hasFields = true;
mp.fields[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
if (requiredFile != null) {
hasFields = true;
mp.fields[r'requiredFile'] = requiredFile.field;
mp.files.add(requiredFile);
}
if (hasFields) {
postBody = mp;
}
} else {
if (additionalMetadata != null) {
formParams[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
bool hasFields = false;
final mp = MultipartRequest('POST', Uri.parse(path));
if (additionalMetadata != null) {
hasFields = true;
mp.fields[r'additionalMetadata'] = parameterToString(additionalMetadata);
}
if (requiredFile != null) {
hasFields = true;
mp.fields[r'requiredFile'] = requiredFile.field;
mp.files.add(requiredFile);
}
if (hasFields) {
postBody = mp;
}
return await apiClient.invokeAPI(

View File

@@ -44,17 +44,6 @@ class StoreApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -101,17 +90,6 @@ class StoreApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['api_key'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -172,17 +150,6 @@ class StoreApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -245,17 +212,6 @@ class StoreApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -43,17 +43,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -108,17 +97,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -171,17 +149,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -237,17 +204,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -303,17 +259,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -383,17 +328,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -447,17 +381,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,
@@ -514,17 +437,6 @@ class UserApi {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>[];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI(
path,

View File

@@ -61,7 +61,7 @@ class ApiClient {
Future<Response> invokeAPI(
String path,
String method,
Iterable<QueryParam> queryParams,
List<QueryParam> queryParams,
Object body,
Map<String, String> headerParams,
Map<String, String> formParams,
@@ -156,13 +156,13 @@ class ApiClient {
List<QueryParam> queryParams,
Map<String, String> headerParams,
) {
authNames.forEach((authName) {
for(final authName in authNames) {
final auth = _authentications[authName];
if (auth == null) {
throw ArgumentError('Authentication undefined: $authName');
}
auth.applyToParams(queryParams, headerParams);
});
}
}
}

View File

@@ -19,6 +19,7 @@ class ApiException implements Exception {
Exception innerException;
StackTrace stackTrace;
@override
String toString() {
if (message == null) {
return 'ApiException';

View File

@@ -28,7 +28,7 @@ Iterable<QueryParam> _convertParametersForCollectionFormat(
final params = <QueryParam>[];
// preconditions
if (name != null && !name.isEmpty && value != null) {
if (name != null && name.isNotEmpty && value != null) {
if (value is List) {
// get the collection format, default: csv
collectionFormat = (collectionFormat == null || collectionFormat.isEmpty)

View File

@@ -5,8 +5,6 @@
name: 'openapi'
version: '1.0.0'
description: 'OpenAPI API client'
authors:
- 'Author <author@homepage>'
homepage: 'homepage'
environment:
sdk: '>=2.12.0 <3.0.0'