poem
poem copied to clipboard
Getting parameter name when ParseRequestPayloadError occurs?
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<Test> 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")"
maybe we can make it work with serde_path_to_error