Remove enterprise leftovers from community
This commit is contained in:
@@ -56,8 +56,6 @@ fn empty_target_context(context: MappingTargetContext) -> Value {
|
||||
("query".to_owned(), Value::Object(Map::new())),
|
||||
("headers".to_owned(), Value::Object(Map::new())),
|
||||
("body".to_owned(), Value::Object(Map::new())),
|
||||
("variables".to_owned(), Value::Object(Map::new())),
|
||||
("grpc".to_owned(), Value::Object(Map::new())),
|
||||
])),
|
||||
)])),
|
||||
MappingTargetContext::Output => Value::Object(Map::from_iter([(
|
||||
|
||||
@@ -9,11 +9,8 @@ pub enum JsonPathRoot {
|
||||
RequestQuery,
|
||||
RequestHeaders,
|
||||
RequestBody,
|
||||
RequestVariables,
|
||||
RequestGrpc,
|
||||
ResponseBody,
|
||||
ResponseData,
|
||||
ResponseGrpc,
|
||||
Output,
|
||||
}
|
||||
|
||||
@@ -25,11 +22,8 @@ impl JsonPathRoot {
|
||||
Self::RequestQuery => "request.query",
|
||||
Self::RequestHeaders => "request.headers",
|
||||
Self::RequestBody => "request.body",
|
||||
Self::RequestVariables => "request.variables",
|
||||
Self::RequestGrpc => "request.grpc",
|
||||
Self::ResponseBody => "response.body",
|
||||
Self::ResponseData => "response.data",
|
||||
Self::ResponseGrpc => "response.grpc",
|
||||
Self::Output => "output",
|
||||
}
|
||||
}
|
||||
@@ -41,11 +35,8 @@ impl JsonPathRoot {
|
||||
Self::RequestQuery => &["request", "query"],
|
||||
Self::RequestHeaders => &["request", "headers"],
|
||||
Self::RequestBody => &["request", "body"],
|
||||
Self::RequestVariables => &["request", "variables"],
|
||||
Self::RequestGrpc => &["request", "grpc"],
|
||||
Self::ResponseBody => &["response", "body"],
|
||||
Self::ResponseData => &["response", "data"],
|
||||
Self::ResponseGrpc => &["response", "grpc"],
|
||||
Self::Output => &["output"],
|
||||
}
|
||||
}
|
||||
@@ -125,16 +116,13 @@ impl JsonPath {
|
||||
}
|
||||
|
||||
fn match_root(input: &str) -> Option<(JsonPathRoot, &str)> {
|
||||
const ROOTS: [(&str, JsonPathRoot); 11] = [
|
||||
("request.variables", JsonPathRoot::RequestVariables),
|
||||
const ROOTS: [(&str, JsonPathRoot); 8] = [
|
||||
("request.headers", JsonPathRoot::RequestHeaders),
|
||||
("response.body", JsonPathRoot::ResponseBody),
|
||||
("response.data", JsonPathRoot::ResponseData),
|
||||
("response.grpc", JsonPathRoot::ResponseGrpc),
|
||||
("request.path", JsonPathRoot::RequestPath),
|
||||
("request.query", JsonPathRoot::RequestQuery),
|
||||
("request.body", JsonPathRoot::RequestBody),
|
||||
("request.grpc", JsonPathRoot::RequestGrpc),
|
||||
("output", JsonPathRoot::Output),
|
||||
("mcp", JsonPathRoot::Mcp),
|
||||
];
|
||||
|
||||
@@ -118,9 +118,7 @@ fn target_root_context(root: JsonPathRoot) -> Option<MappingTargetContext> {
|
||||
JsonPathRoot::RequestPath
|
||||
| JsonPathRoot::RequestQuery
|
||||
| JsonPathRoot::RequestHeaders
|
||||
| JsonPathRoot::RequestBody
|
||||
| JsonPathRoot::RequestVariables
|
||||
| JsonPathRoot::RequestGrpc => Some(MappingTargetContext::Input),
|
||||
| JsonPathRoot::RequestBody => Some(MappingTargetContext::Input),
|
||||
JsonPathRoot::Output => Some(MappingTargetContext::Output),
|
||||
_ => None,
|
||||
}
|
||||
@@ -136,9 +134,7 @@ fn validate_source_root(
|
||||
MappingTargetContext::Output => {
|
||||
matches!(
|
||||
root,
|
||||
JsonPathRoot::ResponseBody
|
||||
| JsonPathRoot::ResponseData
|
||||
| JsonPathRoot::ResponseGrpc
|
||||
JsonPathRoot::ResponseBody | JsonPathRoot::ResponseData
|
||||
)
|
||||
}
|
||||
MappingTargetContext::Mixed => false,
|
||||
@@ -166,8 +162,6 @@ fn validate_target_root(
|
||||
| JsonPathRoot::RequestQuery
|
||||
| JsonPathRoot::RequestHeaders
|
||||
| JsonPathRoot::RequestBody
|
||||
| JsonPathRoot::RequestVariables
|
||||
| JsonPathRoot::RequestGrpc
|
||||
),
|
||||
MappingTargetContext::Output => root == JsonPathRoot::Output,
|
||||
MappingTargetContext::Mixed => false,
|
||||
|
||||
Reference in New Issue
Block a user