mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-03 22:20:56 +00:00
dart2 linter updates for prefer_equal_for_default_values, prefer_is_empty (#2654)
* Use isNotEmpty instead of length in dart2 validity checks In dart2 the preferred method of checking whether an object is empty or not is to use the .isNotEmpty property. An aspect that is now warned about by the linter. While not an issue in this particular case - testing length can also have negative performance implications for Iterable collections, which are not required to know or provide their length deterministically. * Prefer equals for default values in dart2 The dart2 linter complains about m({a: 1}) style assignments, preferring m({a = 1}) instead. Update the api_client generation to follow this. * Regenerate dart2 samples for mustache template changes
This commit is contained in:
parent
e75c8eebc5
commit
c08c45de05
@ -46,7 +46,7 @@ class {{classname}} {
|
||||
|
||||
List<String> contentTypes = [{{#consumes}}"{{{mediaType}}}"{{#hasMore}},{{/hasMore}}{{/consumes}}];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [{{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}}];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
|
@ -18,7 +18,7 @@ class ApiClient {
|
||||
final _regList = RegExp(r'^List<(.*)>$');
|
||||
final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
|
||||
ApiClient({this.basePath: "{{{basePath}}}"}) {
|
||||
ApiClient({this.basePath = "{{{basePath}}}"}) {
|
||||
// Setup authentications (key: authentication name, value: authentication).{{#authMethods}}{{#isBasic}}
|
||||
_authentications['{{name}}'] = HttpBasicAuth();{{/isBasic}}{{#isApiKey}}
|
||||
_authentications['{{name}}'] = ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}");{{/isApiKey}}{{#isOAuth}}
|
||||
|
@ -83,7 +83,7 @@ class {{classname}} {
|
||||
|
||||
static Map<String, {{classname}}> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, {{classname}}>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new {{classname}}.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -44,7 +44,7 @@ Please follow the [installation procedure](#installation--usage) and then run th
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
@ -28,7 +28,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["application/json","application/xml"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -78,7 +78,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -128,7 +128,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -179,7 +179,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -229,7 +229,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["api_key"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -279,7 +279,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["application/json","application/xml"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -328,7 +328,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["application/x-www-form-urlencoded"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -389,7 +389,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["multipart/form-data"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
|
@ -28,7 +28,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -74,7 +74,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["api_key"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -125,7 +125,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -175,7 +175,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
|
@ -28,7 +28,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -77,7 +77,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -126,7 +126,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -175,7 +175,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -224,7 +224,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -279,7 +279,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -326,7 +326,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -378,7 +378,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
|
@ -47,7 +47,7 @@ class ApiResponse {
|
||||
|
||||
static Map<String, ApiResponse> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, ApiResponse>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new ApiResponse.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -39,7 +39,7 @@ class Category {
|
||||
|
||||
static Map<String, Category> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Category>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Category.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -72,7 +72,7 @@ class Order {
|
||||
|
||||
static Map<String, Order> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Order>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Order.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -72,7 +72,7 @@ class Pet {
|
||||
|
||||
static Map<String, Pet> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Pet>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Pet.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -39,7 +39,7 @@ class Tag {
|
||||
|
||||
static Map<String, Tag> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Tag>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Tag.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -87,7 +87,7 @@ class User {
|
||||
|
||||
static Map<String, User> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, User>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new User.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -44,7 +44,7 @@ Please follow the [installation procedure](#installation--usage) and then run th
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
@ -28,7 +28,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["application/json","application/xml"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -78,7 +78,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -128,7 +128,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -179,7 +179,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -229,7 +229,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["api_key"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -279,7 +279,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["application/json","application/xml"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -328,7 +328,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["application/x-www-form-urlencoded"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -389,7 +389,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["multipart/form-data"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
|
@ -28,7 +28,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -74,7 +74,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["api_key"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -125,7 +125,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -175,7 +175,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
|
@ -28,7 +28,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -77,7 +77,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -126,7 +126,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -175,7 +175,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -224,7 +224,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -279,7 +279,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -326,7 +326,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -378,7 +378,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
|
@ -47,7 +47,7 @@ class ApiResponse {
|
||||
|
||||
static Map<String, ApiResponse> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, ApiResponse>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new ApiResponse.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -39,7 +39,7 @@ class Category {
|
||||
|
||||
static Map<String, Category> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Category>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Category.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -72,7 +72,7 @@ class Order {
|
||||
|
||||
static Map<String, Order> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Order>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Order.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -72,7 +72,7 @@ class Pet {
|
||||
|
||||
static Map<String, Pet> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Pet>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Pet.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -39,7 +39,7 @@ class Tag {
|
||||
|
||||
static Map<String, Tag> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Tag>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Tag.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -87,7 +87,7 @@ class User {
|
||||
|
||||
static Map<String, User> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, User>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new User.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -44,7 +44,7 @@ Please follow the [installation procedure](#installation--usage) and then run th
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
@ -28,7 +28,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["application/json","application/xml"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -78,7 +78,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -128,7 +128,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -179,7 +179,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -229,7 +229,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["api_key"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -279,7 +279,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["application/json","application/xml"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -328,7 +328,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["application/x-www-form-urlencoded"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -389,7 +389,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["multipart/form-data"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
|
@ -28,7 +28,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -74,7 +74,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["api_key"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -125,7 +125,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -175,7 +175,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
|
@ -28,7 +28,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -77,7 +77,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -126,7 +126,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -175,7 +175,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -224,7 +224,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -279,7 +279,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -326,7 +326,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -378,7 +378,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
|
@ -47,7 +47,7 @@ class ApiResponse {
|
||||
|
||||
static Map<String, ApiResponse> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, ApiResponse>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new ApiResponse.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -39,7 +39,7 @@ class Category {
|
||||
|
||||
static Map<String, Category> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Category>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Category.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -72,7 +72,7 @@ class Order {
|
||||
|
||||
static Map<String, Order> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Order>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Order.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -72,7 +72,7 @@ class Pet {
|
||||
|
||||
static Map<String, Pet> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Pet>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Pet.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -39,7 +39,7 @@ class Tag {
|
||||
|
||||
static Map<String, Tag> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Tag>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Tag.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -87,7 +87,7 @@ class User {
|
||||
|
||||
static Map<String, User> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, User>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new User.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -44,7 +44,7 @@ Please follow the [installation procedure](#installation--usage) and then run th
|
||||
import 'package:openapi/api.dart';
|
||||
|
||||
// TODO Configure OAuth2 access token for authorization: petstore_auth
|
||||
//openapi.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
//defaultApiClient.getAuthentication<OAuth>('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||
|
||||
var api_instance = new PetApi();
|
||||
var body = new Pet(); // Pet | Pet object that needs to be added to the store
|
||||
|
@ -28,7 +28,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["application/json","application/xml"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -78,7 +78,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -128,7 +128,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -179,7 +179,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -229,7 +229,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["api_key"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -279,7 +279,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["application/json","application/xml"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -328,7 +328,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["application/x-www-form-urlencoded"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -389,7 +389,7 @@ class PetApi {
|
||||
|
||||
List<String> contentTypes = ["multipart/form-data"];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["petstore_auth"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
|
@ -28,7 +28,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -74,7 +74,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = ["api_key"];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -125,7 +125,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -175,7 +175,7 @@ class StoreApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
|
@ -28,7 +28,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -77,7 +77,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -126,7 +126,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -175,7 +175,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -224,7 +224,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -279,7 +279,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -326,7 +326,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
@ -378,7 +378,7 @@ class UserApi {
|
||||
|
||||
List<String> contentTypes = [];
|
||||
|
||||
String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";
|
||||
String contentType = contentTypes.isNotEmpty ? contentTypes[0] : "application/json";
|
||||
List<String> authNames = [];
|
||||
|
||||
if(contentType.startsWith("multipart/form-data")) {
|
||||
|
@ -47,7 +47,7 @@ class ApiResponse {
|
||||
|
||||
static Map<String, ApiResponse> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, ApiResponse>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new ApiResponse.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -39,7 +39,7 @@ class Category {
|
||||
|
||||
static Map<String, Category> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Category>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Category.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -72,7 +72,7 @@ class Order {
|
||||
|
||||
static Map<String, Order> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Order>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Order.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -72,7 +72,7 @@ class Pet {
|
||||
|
||||
static Map<String, Pet> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Pet>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Pet.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -39,7 +39,7 @@ class Tag {
|
||||
|
||||
static Map<String, Tag> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, Tag>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new Tag.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
@ -87,7 +87,7 @@ class User {
|
||||
|
||||
static Map<String, User> mapFromJson(Map<String, dynamic> json) {
|
||||
var map = new Map<String, User>();
|
||||
if (json != null && json.length > 0) {
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic value) => map[key] = new User.fromJson(value));
|
||||
}
|
||||
return map;
|
||||
|
Loading…
x
Reference in New Issue
Block a user