Postman is not working when parameter is empty and [input type = Json]
Problem
When implementing the Post method, if the input type is Json and no parameters are entered, the error Args|EOF while parsing a value at line 1 column 0 is displayed.
Steps To Reproduce
- Write a Post function with input and output type as Json
- Run after build
- Check post API operation with postman
Expected behavior
API normal call
Screenshots
Environment:
- Dioxus version: 0.6.0-alpha.3
- Rust version: 1.81.0
- OS info: Ubuntu 22.04
- App platform: web, fullstack
Questionnaire
#[server(endpoint = "/m1/logs", input=Json, output=Json)]
pub async fn store_data() -> Result<(), ServerFnError> {
Ok(())
}
When you specify the input and output type as Json and call the api, an error saying Args|EOF while parsing a value at line 1 column 0 is displayed. However, if the input type is set to PostUrl, it appears to be called normally even if it is an empty parameter. Wouldn't it be correct to make a normal call even if the input type is Json?
An empty string is an invalid JSON, so you should pass {} as a request body.