We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have to manually rename objects properties from camelCase to snake_case to pass them to tauri invoke (also on the way back).
For instance, if I have rust code like this:
struct Example { pub one_thing: f64; } #[tauri::command] fn echo_example(example_thing: Example) => Result<Example, String> { OK(example_thing) }
Then in javascript I have to do this:
response = await invoke('echo_example`, { exampleThing: { one_thing: 10.5 } }) // format response again formattedResponse = { oneThing: response.one_thing }
You can imagine this is annnoying for deeply nested structs, objects, esp involving arrays/vecs
I'd like to have the case conversion deeply applied.
https://serde.rs/attr-rename.html
Perhaps the Usage of Serde should be suggested in the documentation. No response
The text was updated successfully, but these errors were encountered:
Just add #[serde(rename_all = "camelCase")] on your struct
#[serde(rename_all = "camelCase")]
I believe this is more of a documentation issue, so I will just move to tauri-docs
Sorry, something went wrong.
No branches or pull requests
Describe the problem
I have to manually rename objects properties from camelCase to snake_case to pass them to tauri invoke (also on the way back).
For instance, if I have rust code like this:
Then in javascript I have to do this:
You can imagine this is annnoying for deeply nested structs, objects, esp involving arrays/vecs
Describe the solution you'd like
I'd like to have the case conversion deeply applied.
Alternatives considered
https://serde.rs/attr-rename.html
Additional context
Perhaps the Usage of Serde should be suggested in the documentation.
No response
The text was updated successfully, but these errors were encountered: