From 1119b99c0d8cc952beeb051e667370584f123190 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 5 Aug 2025 16:39:48 +0800 Subject: [PATCH] Update collection validation to ignore empty collection name error - Modified the validation logic in the CreateCollectionRequest to allow the "collection name cannot be empty" error to be ignored during CreateCollectionOptions validation, improving flexibility in request handling. --- openapi/kb/collection.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi/kb/collection.go b/openapi/kb/collection.go index e241da8f..63340da2 100644 --- a/openapi/kb/collection.go +++ b/openapi/kb/collection.go @@ -221,8 +221,8 @@ func validateCreateCollectionRequest(req *CreateCollectionRequest) error { return fmt.Errorf("config is required") } - // Validate CreateCollectionOptions - if err := req.Config.Validate(); err != nil { + // Validate CreateCollectionOptions (ignore collection name cannot be empty error) + if err := req.Config.Validate(); err != nil && err.Error() != "collection name cannot be empty" { return fmt.Errorf("invalid config: %w", err) }