{"record":{"id":"99961cc0e0f01fc9","repo":"juspay/hyperswitch","slug":"failed-to-serialize-default","errorCode":null,"errorMessage":"Failed to serialize default","messagePattern":"Failed to serialize default","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/router/src/core/configs/dimension_config.rs","lineNumber":58,"sourceCode":"macro_rules! config {\n    // Object config variant (with object = true)\n    (\n        superposition_key = $key:ident,\n        output = $output:ty,\n        default = $default:expr,\n        object = true,\n        requires = $requirement:ty,\n        targeting_key = $targeting_type:ty\n    ) => {\n        paste::paste! {\n            pub struct [<$key:camel>];\n\n            impl superposition::Config for [<$key:camel>] {\n                type Output = serde_json::Value;\n                type TargetingKey = $targeting_type;\n                const SUPERPOSITION_KEY: &'static str = superposition_consts::$key;\n                fn default_value() -> Self::Output {\n                    serde_json::to_value(&$default).expect(\"Failed to serialize default\")\n                }\n            }\n\n            impl $requirement {\n                pub async fn [<get_ $key:lower>](\n                    &self,\n                    storage: &dyn StorageInterface,\n                    superposition_client: &superposition::SuperpositionClient,\n                    targeting_key: Option<&$targeting_type>,\n                ) -> $output {\n                    // Fetch JSON and convert to $output using the conversion function\n                    crate::core::configs::fetch_db_config_for_objects::<[<$key:camel>], $output>(\n                        storage, superposition_client, self, targeting_key\n                    ).await\n                }\n            }\n        }\n    };","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/juspay/hyperswitch/blob/3093f22cc46b46415cca152ea0b234277b251ecd/crates/router/src/core/configs/dimension_config.rs#L40-L76","documentation":"Error \"Failed to serialize default\" thrown in juspay/hyperswitch.","triggerScenarios":"Thrown at crates/router/src/core/configs/dimension_config.rs:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the default dimension config value is serializable (valid JSON) in configuration"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3093f22cc46b46415cca152ea0b234277b251ecd","analyzedAt":"2026-08-19T10:36:43.745Z","contentChangedAt":"2026-08-19T10:36:43.745Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}