-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error out with invalid option when createCollection #832
Conversation
throws IOException { | ||
if (deserializer.handledType().toString().endsWith("CreateCollectionCommand$Options")) { | ||
throw ErrorCode.INVALID_CREATE_COLLECTION_OPTIONS.toApiException( | ||
"No option \"%s\" found as createCollectionCommand option", propertyName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is helpful: but even more helpful I think would be listing 2 existing options in addition?
Something like:
"No option \"%s\" found as createCollectionCommand option (known options: \"indexing\", \"vector\")",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not sure if "vectorize"
should be included; it is technically allowed, but not publicly supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solved, thanks
src/main/java/io/stargate/sgv2/jsonapi/exception/ErrorCode.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good: added suggestions. Interesting way of dealing with the issue, nice!
… into invalid_option_createCollection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
When user provides an invalid option when createCollection,
currently, we have three options (case sensitive): vector, vectorize, indexing
Example:
Which issue(s) this PR fixes:
Fixes #828
Checklist