From ae88a7ece59ef5355a7e0c190749c2adce0cbf86 Mon Sep 17 00:00:00 2001 From: Kat Lim Ruiz Date: Tue, 1 Apr 2025 18:06:40 -0500 Subject: [PATCH] add tag type and content value to UserInputBound --- query-grammar/src/user_input_ast.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/query-grammar/src/user_input_ast.rs b/query-grammar/src/user_input_ast.rs index 0b512f675..3a94f7c4d 100644 --- a/query-grammar/src/user_input_ast.rs +++ b/query-grammar/src/user_input_ast.rs @@ -156,6 +156,7 @@ impl fmt::Debug for UserInputLiteral { } #[derive(PartialEq, Debug, Clone, Serialize)] +#[serde(tag = "type", content = "value")] pub enum UserInputBound { Inclusive(String), Exclusive(String), @@ -328,7 +329,7 @@ mod tests { let json = serde_json::to_string(&ast).unwrap(); assert_eq!( json, - r#"{"Leaf":{"type":"Range","field":"price","lower":{"Inclusive":"10"},"upper":{"Exclusive":"100"}}}"# + r#"{"Leaf":{"type":"Range","field":"price","lower":{"type":"Inclusive","value":"10"},"upper":{"type":"Exclusive","value":"100"}}}"# ); }