sova_openapi/
validate_meta.rs1use sova_core::extend::RouteValue;
4use serde_json::Value;
5
6#[derive(Debug, Clone, Default)]
8pub struct OpenApiValidate {
9 pub body: Option<Value>,
10 pub query: Option<Value>,
11 pub params: Option<Value>,
12}
13
14impl RouteValue for OpenApiValidate {
15 fn label(&self) -> std::borrow::Cow<'static, str> {
16 let mut parts = Vec::new();
17 if self.body.is_some() {
18 parts.push("body");
19 }
20 if self.query.is_some() {
21 parts.push("query");
22 }
23 if self.params.is_some() {
24 parts.push("params");
25 }
26 if parts.is_empty() {
27 std::borrow::Cow::Borrowed("OpenApiValidate")
28 } else {
29 std::borrow::Cow::Owned(format!("OpenApiValidate({})", parts.join(",")))
30 }
31 }
32}