Fix bug where all natural fields were excluded
This commit is contained in:
parent
81e6263191
commit
acce9a4bb8
3 changed files with 10 additions and 1 deletions
|
@ -64,7 +64,7 @@ class SerializerGenerator extends GeneratorForAnnotation<Serializable> {
|
||||||
// Add named parameters
|
// Add named parameters
|
||||||
for (var field in ctx.fields) {
|
for (var field in ctx.fields) {
|
||||||
// Skip excluded fields
|
// Skip excluded fields
|
||||||
if (ctx.excluded.containsKey(field.name)) continue;
|
if (ctx.excluded[field.name] == true) continue;
|
||||||
|
|
||||||
var alias = ctx.resolveFieldName(field.name);
|
var alias = ctx.resolveFieldName(field.name);
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,10 @@ abstract class AuthorSerializer {
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
'id': id,
|
'id': id,
|
||||||
|
'name': name,
|
||||||
|
'age': age,
|
||||||
|
'books': books,
|
||||||
|
'newest_book': newestBook,
|
||||||
'created_at': createdAt.toIso8601String(),
|
'created_at': createdAt.toIso8601String(),
|
||||||
'updated_at': updatedAt.toIso8601String()
|
'updated_at': updatedAt.toIso8601String()
|
||||||
};
|
};
|
||||||
|
@ -20,6 +24,7 @@ abstract class LibrarySerializer {
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
'id': id,
|
'id': id,
|
||||||
|
'collection': collection,
|
||||||
'created_at': createdAt.toIso8601String(),
|
'created_at': createdAt.toIso8601String(),
|
||||||
'updated_at': updatedAt.toIso8601String()
|
'updated_at': updatedAt.toIso8601String()
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,6 +10,10 @@ abstract class BookSerializer {
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
return {
|
return {
|
||||||
'id': id,
|
'id': id,
|
||||||
|
'author': author,
|
||||||
|
'title': title,
|
||||||
|
'description': description,
|
||||||
|
'page_count': pageCount,
|
||||||
'created_at': createdAt.toIso8601String(),
|
'created_at': createdAt.toIso8601String(),
|
||||||
'updated_at': updatedAt.toIso8601String()
|
'updated_at': updatedAt.toIso8601String()
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue