Skip to main content

apif_execution/
request_handler.rs

1use apif_ast::SectionContent;
2use serde_json::Value;
3
4#[derive(Default)]
5pub struct RequestHandler;
6
7impl RequestHandler {
8    pub fn new() -> Self {
9        Self
10    }
11    pub fn build_request(&self, content: &SectionContent) -> Option<Value> {
12        match content {
13            SectionContent::Json(v) => Some(v.clone()),
14            SectionContent::Empty => Some(Value::Object(serde_json::Map::new())),
15            _ => None,
16        }
17    }
18}