teo_runtime/handler/input/custom.rs
1use key_path::path;
2use serde_json::{Value as JsonValue};
3use crate::value::Value;
4use crate::coder::json_to_teon::json_to_teon_with_type;
5use crate::handler::Handler;
6use crate::namespace::Namespace;
7
8pub fn validate_and_transform_json_input_for_handler(handler: &Handler, json_body: &JsonValue, main_namespace: &Namespace) -> teo_result::Result<Value> {
9 json_to_teon_with_type(json_body, &path![], handler.input_type(), main_namespace)
10}