Skip to content

[Feature] Allow @polymorphic on class definitions #28

@misha

Description

@misha

Related packages

dogs_core

Feature

When I have a sealed class, I have to remember to tag each usage in @serializable classes with @polymorphic. I frequently forget, and end up discovering the error at runtime when serialization breaks.

Ideally, it becomes possible to tag the class' definition with @polymorphic, or just make the class @serializable with the same intent. (I believe right now it's an error, since abstract classes cannot be instantiated.)

This also reduces lines of code across all my models since all those @polymorphic annotations are usually the only annotation on those fields.

If this is already possible, please let me know. I looked through the documentation site but didn't find a way to do it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions