Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support conditionally skipping fields #16

Open
leostera opened this issue Feb 28, 2024 · 0 comments
Open

Support conditionally skipping fields #16

leostera opened this issue Feb 28, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@leostera
Copy link
Member

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.

@leostera leostera added enhancement New feature or request help wanted Extra attention is needed labels Feb 28, 2024
@leostera leostera added this to the riot/phase-1 milestone Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants