apif-execution 0.2.1

Test execution engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use apif_ast::SectionContent;
use serde_json::Value;

#[derive(Default)]
pub struct RequestHandler;

impl RequestHandler {
    pub fn new() -> Self {
        Self
    }
    pub fn build_request(&self, content: &SectionContent) -> Option<Value> {
        match content {
            SectionContent::Json(v) => Some(v.clone()),
            SectionContent::Empty => Some(Value::Object(serde_json::Map::new())),
            _ => None,
        }
    }
}