use crate::openapi::TextSchema;
#[derive(Debug, Clone)]
pub enum ResponseKind {
Json(String),
Text(Option<TextSchema>),
Binary,
}
impl ResponseKind {
pub fn schema_name(&self) -> Option<&str> {
match self {
Self::Json(s) => Some(s.as_str()),
Self::Text(Some(t)) => Some(t.name.as_str()),
_ => None,
}
}
pub fn text_is_numeric(&self) -> bool {
matches!(self, Self::Text(Some(t)) if t.is_numeric)
}
}