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
@@ -0,0 +1,25 @@
|
||||
use crank_core::HttpMethod;
|
||||
|
||||
use crate::rest::model::{ImportFinding, ImportFindingSeverity};
|
||||
|
||||
pub(super) fn from_lower(value: &str) -> Option<HttpMethod> {
|
||||
match value {
|
||||
"get" => Some(HttpMethod::Get),
|
||||
"post" => Some(HttpMethod::Post),
|
||||
"put" => Some(HttpMethod::Put),
|
||||
"patch" => Some(HttpMethod::Patch),
|
||||
"delete" => Some(HttpMethod::Delete),
|
||||
"head" => Some(HttpMethod::Head),
|
||||
"options" => Some(HttpMethod::Options),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn invalid_path_item() -> ImportFinding {
|
||||
ImportFinding {
|
||||
code: "invalid_path_item".to_owned(),
|
||||
severity: ImportFindingSeverity::Error,
|
||||
message: "Path Item имеет неверную структуру и не был интерпретирован.".to_owned(),
|
||||
operation_key: None,
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user