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.
This commit is contained in:
Max 2025-08-05 16:39:48 +08:00
parent 54bf6c1ed2
commit 1119b99c0d

View file

@ -221,8 +221,8 @@ func validateCreateCollectionRequest(req *CreateCollectionRequest) error {
return fmt.Errorf("config is required") return fmt.Errorf("config is required")
} }
// Validate CreateCollectionOptions // Validate CreateCollectionOptions (ignore collection name cannot be empty error)
if err := req.Config.Validate(); err != nil { if err := req.Config.Validate(); err != nil && err.Error() != "collection name cannot be empty" {
return fmt.Errorf("invalid config: %w", err) return fmt.Errorf("invalid config: %w", err)
} }