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:
parent
54bf6c1ed2
commit
1119b99c0d
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue