Skip to content

Help improve experience with untagged schemas #156

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

Merged
merged 2 commits into from
May 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions _src/container-attrs.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@
Use the untagged enum representation for this enum. See [enum representations]
for details on this representation.

When no variant matches, the error may be uninformative which can be improved with [`serde(expecting)`](#expecting).

In performance-critical code, checking each variant and processing the errors can be slow.
In these cases, it may be better to hand-implement the deserialize trait for which [serde-untagged] may help.

[serde-untagged]: https://docs.rs/serde-untagged

- ##### `#[serde(bound = "T: MyTrait")]` {#bound}

Where-clause for the `Serialize` and `Deserialize` impls. This replaces any
Expand Down