{"record":{"id":"d7f01dc2e8199470","repo":"tauri-apps/tauri","slug":"expected-camelcase-or-snake-case","errorCode":null,"errorMessage":"expected \"camelCase\" or \"snake_case\"","messagePattern":"expected \"camelCase\" or \"snake_case\"","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/tauri-macros/src/command/wrapper.rs","lineNumber":72,"sourceCode":"\n    let attrs = Punctuated::<WrapperAttributeKind, Token![,]>::parse_terminated(input)?;\n    for attr in attrs {\n      match attr {\n        WrapperAttributeKind::Meta(Meta::List(_)) => {\n          return Err(syn::Error::new(input.span(), \"unexpected list input\"));\n        }\n        WrapperAttributeKind::Meta(Meta::NameValue(v)) => {\n          if v.path.is_ident(\"rename_all\") {\n            if let Expr::Lit(ExprLit {\n              lit: Lit::Str(s),\n              attrs: _,\n            }) = v.value\n            {\n              wrapper_attributes.argument_case = match s.value().as_str() {\n                \"snake_case\" => ArgumentCase::Snake,\n                \"camelCase\" => ArgumentCase::Camel,\n                _ => {\n                  return Err(syn::Error::new(\n                    s.span(),\n                    \"expected \\\"camelCase\\\" or \\\"snake_case\\\"\",\n                  ));\n                }\n              };\n            }\n          } else if v.path.is_ident(\"rename\") {\n            if let Expr::Lit(ExprLit {\n              lit: Lit::Str(s), ..\n            }) = v.value\n            {\n              let lit = s.value();\n              wrapper_attributes.rename = RenamePolicy::Rename(quote!(#lit));\n            } else {\n              return Err(syn::Error::new(\n                v.span(),\n                \"expected string literal for rename\",\n              ));","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-macros/src/command/wrapper.rs#L54-L90","documentation":"The rename_all attribute of #[tauri::command] only accepts the exact string literals \"snake_case\" or \"camelCase\". Any other value raises this syn::Error at compile time, pointing at the offending string literal.","triggerScenarios":"#[tauri::command(rename_all = \"kebab-case\")], rename_all = \"SCREAMING_SNAKE_CASE\", a typo like \"camelcase\", or passing a non-literal expression such as rename_all = MY_CASE.","commonSituations":"Assuming serde's full rename_all vocabulary (kebab-case, PascalCase, UPPER CASE) is supported; typos in casing; forgetting quotes around the value.","solutions":["Change the value to exactly \"snake_case\" or \"camelCase\"","If kebab-case etc. is needed, rename parameters manually with the `rename` attribute instead","Quote the value: rename_all = \"camelCase\" (not rename_all = camelCase)"],"exampleFix":"// before\n#[tauri::command(rename_all = \"kebab-case\")]\n// after\n#[tauri::command(rename_all = \"camelCase\")]","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember only \"snake_case\" and \"camelCase\" are accepted (unlike serde)","Double-check quoting and exact spelling of the case value","Rename to other casings per-argument with the `rename` attribute instead"],"tags":["proc-macro","tauri","compile-time","naming"],"backgroundTag":"invalid-enum-argument","analyzedSha":"460ec35447493200d64290dd7f015d5a91d0fd58","analyzedAt":"2026-09-18T23:55:51.277Z","contentChangedAt":"2026-09-18T23:55:51.277Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}