pub fn load_cwe_mapping_from_str(json: &str) -> Result<CweMapping, Error>Expand description
Deserializes a CWE mapping from a JSON string
§Arguments
json- JSON string containing the CWE mapping data
§Errors
Returns an error if the JSON is invalid
§Example
use bugcrowd_vrt::load_cwe_mapping_from_str;
let json = r#"{
"metadata": {"default": null},
"content": [
{"id": "xss", "cwe": ["CWE-79"]}
]
}"#;
let mapping = load_cwe_mapping_from_str(json).expect("Failed to parse");
assert_eq!(mapping.content.len(), 1);