diff --git a/ee/tabby-schema/src/schema/mod.rs b/ee/tabby-schema/src/schema/mod.rs index c2a9bd9fd169..504b9ef0a02a 100644 --- a/ee/tabby-schema/src/schema/mod.rs +++ b/ee/tabby-schema/src/schema/mod.rs @@ -1318,19 +1318,10 @@ fn from_validation_errors(error: ValidationErrors) -> FieldError error.errors().iter().for_each(|(field, kind)| match kind { validator::ValidationErrorsKind::Struct(e) => { - for (_, error) in e.0.iter() { - if let validator::ValidationErrorsKind::Field(field_errors) = error { - for error in field_errors { - let mut obj = Object::with_capacity(2); - obj.add_field("path", Value::scalar(field.to_string())); - obj.add_field( - "message", - Value::scalar(error.message.clone().unwrap_or_default().to_string()), - ); - errors.push(obj.into()); - } - } - } + let mut obj = Object::with_capacity(2); + obj.add_field("path", field.to_string().into()); + obj.add_field("message", Value::scalar(e.to_string())); + errors.push(obj.into()); } validator::ValidationErrorsKind::List(_) => { warn!("List errors are not handled"); diff --git a/ee/tabby-schema/src/schema/thread/inputs.rs b/ee/tabby-schema/src/schema/thread/inputs.rs index b495b153d3c8..70d7d76edfa0 100644 --- a/ee/tabby-schema/src/schema/thread/inputs.rs +++ b/ee/tabby-schema/src/schema/thread/inputs.rs @@ -25,6 +25,7 @@ pub struct CreateThreadAndRunInput { #[validate(nested)] pub thread: CreateThreadInput, + #[validate(nested)] #[graphql(default)] pub options: ThreadRunOptionsInput, }