{"record":{"id":"15b09fe1bf717bf2","repo":"juspay/hyperswitch","slug":"please-use-the-macro-with-attribute-encrypt-on","errorCode":null,"errorMessage":"Please use the macro with attribute #[encrypt] on the fields you want to encrypt","messagePattern":"Please use the macro with attribute #\\[encrypt\\] on the fields you want to encrypt","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/router_derive/src/macros/to_encryptable.rs","lineNumber":246,"sourceCode":"/// This function generates the temporary struct and ToEncryptable impls for the temporary structs\nfn generate_to_encryptable(\n    struct_name: Ident,\n    fields: Vec<Field>,\n) -> syn::Result<proc_macro2::TokenStream> {\n    let struct_types = [\n        // The first two are to be used as return types we do not need to implement ToEncryptable\n        // on it\n        (\"Decrypted\", StructType::Decrypted),\n        (\"DecryptedUpdate\", StructType::DecryptedUpdate),\n        (\"FromRequestEncryptable\", StructType::FromRequest),\n        (\"Encrypted\", StructType::Encrypted),\n        (\"UpdateEncryptable\", StructType::Updated),\n    ];\n\n    let inner_types = get_field_and_inner_types(&fields);\n\n    let inner_type = inner_types.first().ok_or_else(|| {\n        syn::Error::new(\n            proc_macro2::Span::call_site(),\n            \"Please use the macro with attribute #[encrypt] on the fields you want to encrypt\",\n        )\n    })?;\n\n    let provided_ty = get_encryption_ty_meta(&inner_type.0)\n        .map(|ty| ty.value.clone())\n        .unwrap_or(inner_type.1.clone());\n\n    let structs = struct_types.iter().map(|(prefix, struct_type)| {\n        let name = format_ident!(\"{}{}\", prefix, struct_name);\n        let temp_fields = struct_type.generate_struct_fields(&inner_types);\n        quote! {\n            pub struct #name {\n                #(#temp_fields,)*\n            }\n        }\n    });","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/juspay/hyperswitch/blob/705a3219504c3cf9034e71d956455f8834ea4e64/crates/router_derive/src/macros/to_encryptable.rs#L228-L264","documentation":"Error \"Please use the macro with attribute #[encrypt] on the fields you want to encrypt\" thrown in juspay/hyperswitch.","triggerScenarios":"Thrown at crates/router_derive/src/macros/to_encryptable.rs:246 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Mark the fields to encrypt with the #[encrypt] attribute as instructed"],"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-14T05:17:10.506Z"}