risingwavelabs/risingwave · error

Expected #[serde_prefix_all(skip)]

Error message

Expected #[serde_prefix_all(skip)]

What it means

Inside take_skip_attr, a #[serde_prefix_all(...)] attribute on a variant or field contained a nested argument that was not exactly the bare path `skip` (e.g. `#[serde_prefix_all(rename_all)]` or `#[serde_prefix_all(skip = true)]`). The macro only accepts `skip` inside this inner attribute, so any other nested meta is rejected with this message.

Source

Thrown at src/common/proc_macro/src/serde_prefix_all.rs:172

    let mut filtered = Vec::with_capacity(attrs.len());

    for attr in attrs.drain(..) {
        if !attr.path.is_ident("serde_prefix_all") {
            filtered.push(attr);
            continue;
        }

        let meta = attr.parse_meta()?;
        match meta {
            Meta::List(list) => {
                let mut has_skip = false;
                for nested in &list.nested {
                    match nested {
                        NestedMeta::Meta(Meta::Path(path)) if path.is_ident("skip") => {
                            has_skip = true;
                        }
                        _ => {
                            return Err(Error::new(
                                nested.span(),
                                "Expected #[serde_prefix_all(skip)]",
                            ));
                        }
                    }
                }

                if !has_skip {
                    return Err(Error::new(
                        list.span(),
                        "Expected #[serde_prefix_all(skip)]",
                    ));
                }

                found_skip = true;
            }
            _ => {
                return Err(Error::new(

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Change the nested argument to the bare identifier `skip`: `#[serde_prefix_all(skip)]`.
  2. Remove the inner attribute entirely if the field/variant should be prefixed.
  3. Move configuration such as mode="rename" to the top-level #[serde_prefix_all(..., mode = "rename")] usage.

Example fix

// before
#[serde_prefix_all(skip = true)]
field: u32,

// after
#[serde_prefix_all(skip)]
field: u32,
Defensive patterns

Strategy: validation

Validate before calling

// The only valid inner form on a field/variant is:
// #[serde_prefix_all(skip)]
// Reject anything else:
fn is_valid_inner(attr: &str) -> bool {
    let inner = attr.trim_start_matches("#[serde_prefix_all(").trim_end_matches(")");
    inner.trim() == "skip"
}

Prevention

When it happens

Trigger: Writing `#[serde_prefix_all(alias)]` or `#[serde_prefix_all(skip = "x")]` or `#[serde_prefix_all(anything_else)]` on an enum variant or struct field. Any nested item that is not `NestedMeta::Meta(Meta::Path)` with ident `skip` triggers this.

Common situations: Users guessing at the inner-attribute syntax and trying to pass configuration like rename/alias mode into the field-level attribute (mode belongs in the top-level macro args); typos like `skipped`; copying serde attribute styles into serde_prefix_all.

Understand the failure class

Background: "invalid argument", "unknown mode", "not supported": invalid enum-like argument errors explained — this error's family across 19 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/d4320711afd89861. Report an issue: GitHub.