-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Validate String based aggregation on query method creation. #4547
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
Conversation
This commit makes sure to fail early if an annotated string based annotation does not contain a syntactically valid pipeline.
@@ -504,6 +504,16 @@ public void verify() { | |||
} | |||
} | |||
} | |||
if (hasAnnotatedAggregation()) { | |||
for (String stage : getAnnotatedAggregation()) { |
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.
How about using ParameterBindingJsonReader
to verify that each declaration contains a single object?
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.
The QueryMethod
itself does at this point not know about any parameters nor the parser to use so any validation attempt would be quite error prone due to the potential, non resolvable placeholders contained in the source string.
However there's BsonUtils#isJsonArray
which we might want to reuse.
Related to: #4546