{"record":{"id":"db3b9fe53981f09a","repo":"biomejs/biome","slug":"a-list-of-attribute-is-expected","errorCode":null,"errorMessage":"A list of attribute is expected","messagePattern":"A list of attribute is expected","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/biome_deserialize_macros/src/util.rs","lineNumber":8,"sourceCode":"use syn::{Error, Meta, MetaList, NestedMeta, spanned::Spanned};\n\npub(crate) fn parse_meta_list(\n    meta: &Meta,\n    mut consume: impl FnMut(&Meta) -> Result<(), Error>,\n) -> Result<(), Error> {\n    let Meta::List(MetaList { nested, .. }) = meta else {\n        return Err(Error::new(meta.span(), \"A list of attribute is expected\"));\n    };\n    for nested_meta in nested {\n        let NestedMeta::Meta(meta) = nested_meta else {\n            return Err(Error::new(nested_meta.span(), \"Literals are not allowed\"));\n        };\n        consume(meta)?;\n    }\n    Ok(())\n}\n","sourceCodeStart":1,"sourceCodeEnd":18,"githubUrl":"https://github.com/biomejs/biome/blob/405dedb0ff65dd29927faf587f6542e3c29db248/crates/biome_deserialize_macros/src/util.rs#L1-L18","documentation":"Compile-time error from biome_deserialize_macros' parse_meta_list helper (util.rs:8), used by the #[deserializable] and serde-compat attribute parsers. It requires the attribute to be in list form - Meta::List, i.e. name(...) with parentheses and nested items. If the attribute is a bare path (deprecated with no parentheses) or a name-value pair (name = \"value\"), the let-else fails and this 'A list of attribute is expected' error is emitted at the attribute's span.","triggerScenarios":"#[deserializable(deprecated)] (bare word, no parentheses), or a name-value form where a list is expected, e.g. writing an attribute as key = \"value\" when the parser expects key(...).","commonSituations":"Typing shorthand boolean-style attributes; converting a flag-style attribute into deserializable syntax; IDE auto-complete inserting just the path without the list.","solutions":["Write the attribute in list form with parentheses: #[deserializable(deprecated(message = \"...\"))]","If you intended a bare flag, pick the supported inner item that expresses it (e.g. deprecated(use_instead = \"...\")) instead of the bare word","Check nearby fields in the same crate for working examples of the attribute syntax"],"exampleFix":"// before\n#[deserializable(deprecated)]\npub old_field: bool,\n\n// after\n#[deserializable(deprecated(use_instead = \"NewField\"))]\npub old_field: bool,","handlingStrategy":"validation","validationCode":"// Rust - attributes must be written in list form: name(...)\n#[deserializable(deprecated(message = \"...\"))] // parentheses required","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write derive attributes with parentheses and at least one inner meta","Reject IDE completions that insert a bare path without the list","Copy working attribute syntax from neighboring fields in the same struct"],"tags":["rust","proc-macro","compile-time","deserializable","attributes"],"backgroundTag":"derive-macro-attribute-validation","analyzedSha":"405dedb0ff65dd29927faf587f6542e3c29db248","analyzedAt":"2026-08-20T00:25:09.682Z","contentChangedAt":"2026-08-20T00:25:09.682Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}