juspay/hyperswitch · error · syn::Error

At least one ident must be specified

Error message

At least one ident must be specified

What it means

Error "At least one ident must be specified" thrown in juspay/hyperswitch.

Source

Thrown at crates/router_derive/src/macros/to_encryptable.rs:78

/// In the case of `Encryptable<Secret<String>>> this returns String
fn get_inner_most_type(ty: SynType) -> syn::Result<Ident> {
    fn get_inner_type_recursive(path: syn::TypePath) -> syn::Result<syn::TypePath> {
        match get_inner_type(&path) {
            Ok(inner_path) => get_inner_type_recursive(inner_path),
            Err(_) => Ok(path),
        }
    }

    match ty {
        SynType::Path(path) => {
            let inner_path = get_inner_type_recursive(path)?;
            inner_path
                .path
                .segments
                .last()
                .map(|last_segment| last_segment.ident.to_owned())
                .ok_or_else(|| {
                    syn::Error::new(
                        proc_macro2::Span::call_site(),
                        "At least one ident must be specified",
                    )
                })
        }
        _ => Err(syn::Error::new(
            proc_macro2::Span::call_site(),
            "Only path fields are supported",
        )),
    }
}

/// This returns the field which implement #[encrypt] attribute
fn get_encryptable_fields(fields: Punctuated<Field, Comma>) -> Vec<Field> {
    fields
        .into_iter()
        .filter(|field| {
            field

View on GitHub (pinned to 705a321950)

Solutions

  1. Provide at least one identifier in the to_encryptable macro invocation

When it happens

Trigger: Thrown at crates/router_derive/src/macros/to_encryptable.rs:78 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of juspay/hyperswitch@705a321950 (2026-08-19). Data as JSON: /api/errors/3ffc69b6406822b5. Report an issue: GitHub.