Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/06-concepts/03-serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ For most purposes, you will want to use Serverpod's native serialization. Howeve

```dart
Map<String, dynamic> toJson() {
return {
return {
name: 'John Doe',
};
};
}
```

2. There must be a constructor or factory called `fromJson()`, which takes a JSON serialization as parameters.

```dart
factory ClassName.fromJson(
Map<String, dynamic> json,
Map<String, dynamic> json,
) {
return ClassName(
return ClassName(
name: json['name'] as String,
);
);
}
```

Expand Down
2 changes: 1 addition & 1 deletion docs/06-concepts/08-caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Future<UserData> getUserData(Session session, int userId) async {
() async => UserData.db.findById(session, userId),
lifetime: Duration(minutes: 5),
),
);
);

// Return the user data to the client
return userData;
Expand Down
Loading