// JSON factory shims for e2e test layer.
// These let generated tests deserialise fixture JSON into opaque swift-bridge types.

pub fn extraction_config_from_json(json: String) -> Result<ExtractionConfig, String> {
    serde_json::from_str::<{{ source_crate }}::ExtractionConfig>(&json)
        .map_err(|e| e.to_string())
        .map(ExtractionConfig)
}

pub fn batch_bytes_item_from_json(json: String) -> Result<BatchBytesItem, String> {
    serde_json::from_str::<{{ source_crate }}::BatchBytesItem>(&json)
        .map_err(|e| e.to_string())
        .map(BatchBytesItem)
}

pub fn batch_file_item_from_json(json: String) -> Result<BatchFileItem, String> {
    serde_json::from_str::<{{ source_crate }}::BatchFileItem>(&json)
        .map_err(|e| e.to_string())
        .map(BatchFileItem)
}
