Skip to content
This repository was archived by the owner on Mar 22, 2026. It is now read-only.
This repository was archived by the owner on Mar 22, 2026. It is now read-only.

Support tagging modes #20

@leostera

Description

@leostera

When serializing/deserializing values of a variant type, we'd like the constructor name placement to be configurable.

  • Internally tagged with a new name:
type user [@@serde {tag = "type"}]

On an variant: Use the internally tagged enum representation, with the given tag.
On a record: Serialize the record name as a field with the given key, in front of all the real fields of the struct.

  • Adjacently tagged with tag and content in different fields (only for variants):
type user [@@serde {tag = "t"; content = "c"}]
  • Untagged (only for variants):
type user [@@serde { untagged }]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions