Skip to content

Feature: Generate client serialization classes #56

@wstrange

Description

@wstrange

Something that serverpod.dev does that is pretty nifty is to generate model serialization code, and put the classes in a separate dart client package. It makes it really easy for a developer to pull the client package into a flutter app (or any client app). Until you use it, it's hard to appreciate what a game changer it is. It makes development much faster.

One thought might be to use something like Freezed to define the "model" class, with the proper annotations. Freezed gives you serialization, and a bunch of other nice features.

There are going to be properties of a freezed model that you don't want sent to the database. I think you could handle those using some kind of @ignore annotation (or re-use JsonKey?).

Food for thought..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions