{"record":{"id":"524be76320266830","repo":"leptos-rs/leptos","slug":"unrecognized-server-attribute-expected-serve","errorCode":null,"errorMessage":"Unrecognized #[server] attribute, expected #[server(default)] or #[server(rename = \"fieldName\")]","messagePattern":"Unrecognized #\\[server\\] attribute, expected #\\[server\\(default\\)\\] or #\\[server\\(rename = \"fieldName\"\\)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server_fn_macro/src/lib.rs","lineNumber":1405,"sourceCode":"                            Ok(attr.clone())\n                        }\n                        // #[server(default = \"value\")]\n                        Meta::NameValue(name_value)\n                            if name_value.path.is_ident(\"default\") =>\n                        {\n                            Ok(attr.clone())\n                        }\n                        // #[server(skip)]\n                        Meta::Path(path) if path.is_ident(\"skip\") => {\n                            Ok(attr.clone())\n                        }\n                        // #[server(rename = \"value\")]\n                        Meta::NameValue(name_value)\n                            if name_value.path.is_ident(\"rename\") =>\n                        {\n                            Ok(attr.clone())\n                        }\n                        _ => Err(Error::new(\n                            attr.span(),\n                            \"Unrecognized #[server] attribute, expected \\\n                             #[server(default)] or #[server(rename = \\\n                             \\\"fieldName\\\")]\",\n                        )),\n                    }\n                } else if attr.path().is_ident(\"doc\") {\n                    // Allow #[doc = \"documentation\"]\n                    Ok(attr.clone())\n                } else if attr.path().is_ident(\"allow\") {\n                    // Allow #[allow(...)]\n                    Ok(attr.clone())\n                } else if attr.path().is_ident(\"deny\") {\n                    // Allow #[deny(...)]\n                    Ok(attr.clone())\n                } else if attr.path().is_ident(\"ignore\") {\n                    // Allow #[ignore]\n                    Ok(attr.clone())","sourceCodeStart":1387,"sourceCodeEnd":1423,"githubUrl":"https://github.com/leptos-rs/leptos/blob/32d20f6c9d517451d77beb68d88c7716823dac41/server_fn_macro/src/lib.rs#L1387-L1423","documentation":"On struct fields of a server-function argument struct, the macro only recognizes #[server(default)] and #[server(rename = \"fieldName\")] (and paths for the latter form). Any other #[server(...)] meta on a field is rejected with this message naming the two allowed forms.","triggerScenarios":"#[server(skip)] or #[server(flatten)] on a field; #[server(rename)] without a value; copying serde-style attributes onto fields where only default/rename are supported.","commonSituations":"Developers assuming full serde attribute parity; migrating from another derive that supported more field options; typo like `renamed = \"x\"`.","solutions":["Restrict field attributes to #[server(default)] or #[server(rename = \"fieldName\").","For other serde behavior, use the actual serde attributes handled by your input derive instead of #[server(...)].","Fix typos in `rename` and supply the required \"value\"."],"exampleFix":"// before\n#[server(skip)]\nfield: String,\n// after\n#[serde(skip)]\n#[server]\nfield: String,","handlingStrategy":"validation","validationCode":"let allowed = [\"default\", \"rename\"];\nlet attr_meta = \"skip\"; // contents of #[server(...)] on a field\nassert!(allowed.contains(&attr_meta) || attr_meta.starts_with(\"rename \"), \"field attr must be #[server(default)] or #[server(rename = \\\"x\\\")]\" );","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use serde attributes for serde-only behaviors","Keep field attribute usage to the two documented forms","Check docs after upgrading server_fn for new field options"],"tags":["rust","proc-macro","attribute","field-attribute"],"backgroundTag":"unrecognized-attribute","analyzedSha":"32d20f6c9d517451d77beb68d88c7716823dac41","analyzedAt":"2026-09-01T18:55:42.580Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}