We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Json: { "data": { "PersonInfo": { "name": "Eric" }, "PersonInfoList": [ { "name": "Eric" } ] } }
Output: class GQLResponse { Data data;
GQLResponse({this.data});
GQLResponse.fromJson(Map<String, dynamic> json) { data = json['data'] != null ? new Data.fromJson(json['data']) : null; }
Map<String, dynamic> toJson() { final Map<String, dynamic> data = new Map<String, dynamic>(); if (this.data != null) { data['data'] = this.data.toJson(); } return data; } }
class Data { PersonInfo personInfo; List personInfoList;
Data({this.personInfo, this.personInfoList});
Data.fromJson(Map<String, dynamic> json) { personInfo = json['PersonInfo'] != null ? new PersonInfo.fromJson(json['PersonInfo']) : null; if (json['PersonInfoList'] != null) { personInfoList = new List(); json['PersonInfoList'].forEach((v) { personInfoList.add(new PersonInfoList.fromJson(v)); }); } }
Map<String, dynamic> toJson() { final Map<String, dynamic> data = new Map<String, dynamic>(); if (this.personInfo != null) { data['PersonInfo'] = this.personInfo.toJson(); } if (this.personInfoList != null) { data['PersonInfoList'] = this.personInfoList.map((v) => v.toJson()).toList(); } return data; } }
class PersonInfo { String name;
PersonInfo({this.name});
PersonInfo.fromJson(Map<String, dynamic> json) { name = json['name']; }
Map<String, dynamic> toJson() { final Map<String, dynamic> data = new Map<String, dynamic>(); data['name'] = this.name; return data; } }
The class PersonInfoList is missing but used in generated code, thanks if you can fix this.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Json:
{
"data": {
"PersonInfo": {
"name": "Eric"
},
"PersonInfoList": [
{
"name": "Eric"
}
]
}
}
Output:
class GQLResponse {
Data data;
GQLResponse({this.data});
GQLResponse.fromJson(Map<String, dynamic> json) {
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.data != null) {
data['data'] = this.data.toJson();
}
return data;
}
}
class Data {
PersonInfo personInfo;
List personInfoList;
Data({this.personInfo, this.personInfoList});
Data.fromJson(Map<String, dynamic> json) {
personInfo = json['PersonInfo'] != null
? new PersonInfo.fromJson(json['PersonInfo'])
: null;
if (json['PersonInfoList'] != null) {
personInfoList = new List();
json['PersonInfoList'].forEach((v) {
personInfoList.add(new PersonInfoList.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.personInfo != null) {
data['PersonInfo'] = this.personInfo.toJson();
}
if (this.personInfoList != null) {
data['PersonInfoList'] =
this.personInfoList.map((v) => v.toJson()).toList();
}
return data;
}
}
class PersonInfo {
String name;
PersonInfo({this.name});
PersonInfo.fromJson(Map<String, dynamic> json) {
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['name'] = this.name;
return data;
}
}
The class PersonInfoList is missing but used in generated code, thanks if you can fix this.
The text was updated successfully, but these errors were encountered: