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

Remove enumset optional dependency #339

Merged
merged 2 commits into from
Sep 9, 2024
Merged

Remove enumset optional dependency #339

merged 2 commits into from
Sep 9, 2024

Conversation

GREsau
Copy link
Owner

@GREsau GREsau commented Sep 9, 2024

While updating integration tests, I discovered that the JsonSchema impl for enumset does not accurately represent how it is de/serialized by default. By default, it's serialized as an integer, but the JsonSchema impl assumes that it's a set (or in JSON, an array) of variant names.

It's possible to fix the impl, but I'm concerned that some consumers may be subtly broken by changing the behaviour (even if it's actually "fixing" it). I'm honestly more comfortable removing it entirely to make it more obviously "blow up" at compile-time, and then consumers can decide whether they want the old behaviour (e.g. #[schemars(with = "BTreeSet<Enum>")]) or a schema corresponding to the actual default serialization format for enumset (e.g. #[schemars(with = "u64")]).

The `JsonSchema` impl for enumset does not accurately represent how it is de/serialized by default
@GREsau GREsau merged commit 65346d6 into master Sep 9, 2024
8 checks passed
@GREsau GREsau deleted the remove_enumset branch September 9, 2024 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant