{"record":{"id":"7ce2c46b8b8c0680","repo":"juspay/hyperswitch","slug":"this-macro-cannot-be-used-on-structs-with-no-field","errorCode":null,"errorMessage":"This macro cannot be used on structs with no fields","messagePattern":"This macro cannot be used on structs with no fields","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/router_derive/src/macros/helpers.rs","lineNumber":60,"sourceCode":"        .into_iter()\n        .filter(|attr| attr.path().is_ident(ident))\n        .try_fold(Vec::new(), |mut vec, attr| {\n            vec.extend(attr.parse_args_with(Punctuated::<T, Token![,]>::parse_terminated)?);\n            Ok(vec)\n        })\n}\n\npub(super) fn get_struct_fields(\n    data: syn::Data,\n) -> syn::Result<Punctuated<syn::Field, syn::token::Comma>> {\n    if let syn::Data::Struct(syn::DataStruct {\n        fields: syn::Fields::Named(syn::FieldsNamed { ref named, .. }),\n        ..\n    }) = data\n    {\n        Ok(named.to_owned())\n    } else {\n        Err(syn::Error::new(\n            Span::call_site(),\n            \"This macro cannot be used on structs with no fields\",\n        ))\n    }\n}\n","sourceCodeStart":42,"sourceCodeEnd":66,"githubUrl":"https://github.com/juspay/hyperswitch/blob/705a3219504c3cf9034e71d956455f8834ea4e64/crates/router_derive/src/macros/helpers.rs#L42-L66","documentation":"Error \"This macro cannot be used on structs with no fields\" thrown in juspay/hyperswitch.","triggerScenarios":"Thrown at crates/router_derive/src/macros/helpers.rs:60 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add at least one field to the struct, or remove the derive macro from the empty struct"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"705a3219504c3cf9034e71d956455f8834ea4e64","analyzedAt":"2026-08-19T10:36:43.745Z","contentChangedAt":"2026-08-19T10:36:43.745Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}