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

Getting parameter name when ParseRequestPayloadError occurs? #704

Open
mmittnacht opened this issue Dec 14, 2023 · 1 comment
Open

Getting parameter name when ParseRequestPayloadError occurs? #704

mmittnacht opened this issue Dec 14, 2023 · 1 comment
Labels
question Further information is requested

Comments

@mmittnacht
Copy link

Hello,

I would implement some type of custom error message when the sent request has missing fields. The problem I have is, I can't find a way to extract the column name. For example I have this test struct.

struct Test {
pub test1: String,
pub test2: String,
}

If in a Json requets body test1 is sent, but test2 is not, how could I get the missing param name, because the error message does not send this information: "parse request payload error: Expected input type "string", found null. (occurred while parsing "Test")"

@mmittnacht mmittnacht added the question Further information is requested label Dec 14, 2023
@attila-lin
Copy link
Collaborator

maybe we can make it work with serde_path_to_error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants