feat(import): preserve supported HTTP contracts
This commit is contained in:
1 parent
083974c27f
commit
f8ee7c9bfe
87 files changed
+7496
-534
No files matched your search
@@ -8,7 +8,9 @@ pub enum JsonPathRoot {
|
||||
RequestPath,
|
||||
RequestQuery,
|
||||
RequestHeaders,
|
||||
RequestCookies,
|
||||
RequestBody,
|
||||
RequestBodyContentType,
|
||||
ResponseBody,
|
||||
ResponseData,
|
||||
Output,
|
||||
@@ -21,7 +23,9 @@ impl JsonPathRoot {
|
||||
Self::RequestPath => "request.path",
|
||||
Self::RequestQuery => "request.query",
|
||||
Self::RequestHeaders => "request.headers",
|
||||
Self::RequestCookies => "request.cookies",
|
||||
Self::RequestBody => "request.body",
|
||||
Self::RequestBodyContentType => "request.body_content_type",
|
||||
Self::ResponseBody => "response.body",
|
||||
Self::ResponseData => "response.data",
|
||||
Self::Output => "output",
|
||||
@@ -34,7 +38,9 @@ impl JsonPathRoot {
|
||||
Self::RequestPath => &["request", "path"],
|
||||
Self::RequestQuery => &["request", "query"],
|
||||
Self::RequestHeaders => &["request", "headers"],
|
||||
Self::RequestCookies => &["request", "cookies"],
|
||||
Self::RequestBody => &["request", "body"],
|
||||
Self::RequestBodyContentType => &["request", "body_content_type"],
|
||||
Self::ResponseBody => &["response", "body"],
|
||||
Self::ResponseData => &["response", "data"],
|
||||
Self::Output => &["output"],
|
||||
@@ -116,8 +122,13 @@ impl JsonPath {
|
||||
}
|
||||
|
||||
fn match_root(input: &str) -> Option<(JsonPathRoot, &str)> {
|
||||
const ROOTS: [(&str, JsonPathRoot); 8] = [
|
||||
const ROOTS: [(&str, JsonPathRoot); 10] = [
|
||||
(
|
||||
"request.body_content_type",
|
||||
JsonPathRoot::RequestBodyContentType,
|
||||
),
|
||||
("request.headers", JsonPathRoot::RequestHeaders),
|
||||
("request.cookies", JsonPathRoot::RequestCookies),
|
||||
("response.body", JsonPathRoot::ResponseBody),
|
||||
("response.data", JsonPathRoot::ResponseData),
|
||||
("request.path", JsonPathRoot::RequestPath),
|
||||
|
||||
Reference in new issue
Block a user