Skip to content

Remove enumset optional dependency#339

Merged
GREsau merged 2 commits intomasterfrom
remove_enumset
Sep 9, 2024
Merged

Remove enumset optional dependency#339
GREsau merged 2 commits intomasterfrom
remove_enumset

Conversation

@GREsau
Copy link
Copy Markdown
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
@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