kode_bridge/response.rs
1use crate::errors::AnyResult;
2use serde::{Deserialize, Serialize};
3use serde_json::Value;
4
5/// Legacy response format for backward compatibility
6#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
7pub struct LegacyResponse {
8 pub status: u16,
9 pub headers: Value,
10 pub body: String,
11}
12
13impl LegacyResponse {
14 pub fn json(&self) -> AnyResult<Value> {
15 serde_json::from_str(&self.body).map_err(Into::into)
16 }
17}