Skip to content

Better QueryInterface untagged enum message - #5546

Merged
coszio merged 1 commit into
devfrom
better-untagged-enum-message
Nov 28, 2024
Merged

coszio merged 1 commit into
devfrom
better-untagged-enum-message

Conversation

@coszio

@coszio coszio commented Nov 28, 2024

Copy link
Copy Markdown
Contributor

Previously:
"Format error in JSON body: data did not match any variant of untagged enum QueryInterface at line 1 column 16"

Now:
"Format error in JSON body: Expected some form of vector, id, or a type of query at line 1 column 16"

I did try to use strum crate to list the exact variants that are allowed, but #[serde(expecting = "...")] only allows string literals, so even when I could construct a const &str which was descriptive enough, I could not use it without reimplementing Deserialize for the type.

@ffuugoo

ffuugoo commented Nov 28, 2024

Copy link
Copy Markdown
Contributor

I had no idea expecting exists. Great find! 🤯🎉

@coszio

coszio commented Nov 28, 2024

Copy link
Copy Markdown
Contributor Author

I learned about it today!

@coszio
coszio merged commit ed668c6 into dev Nov 28, 2024
@coszio
coszio deleted the better-untagged-enum-message branch November 28, 2024 22:26
@timvisee

Copy link
Copy Markdown
Member

I had no idea expecting exists. Great find! 🤯🎉

Dang! That must be a new thing! 🙌

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.

3 participants