Skip to content

Support conditionally skipping fields #16

@leostera

Description

@leostera

At the moment there is not attribute support for skipping a field, but we'd like to implement it like Serde.rs does:

let is_new () = true

type user = {
  name: string;
  password: string [@serde { skip; } ];
  created_at: string [@serde { skip_if = is_new () } ]
}
[@@deriving serialize, deserialize]

The expected behavior is that the field will be skipped when found via the next_field call and the field visitor that gets generated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions