Validation of the _source to reject contradicting and ambiguous requests#20742
Validation of the _source to reject contradicting and ambiguous requests#20742urmichm wants to merge 16 commits intoopensearch-project:mainfrom
_source to reject contradicting and ambiguous requests#20742Conversation
PR Reviewer Guide 🔍(Review updated until commit 68fd820)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 0b4c2c8 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 9d97f05
Suggestions up to commit 68f6ccd
Suggestions up to commit 47acc2f
Suggestions up to commit 35b7268
Suggestions up to commit 7f7eff2
|
|
❌ Gradle check result for c2718e8: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 418c9b7 |
|
Persistent review updated to latest commit 8f222c4 |
|
Persistent review updated to latest commit 49d359c |
68fd820 to
5848b18
Compare
|
Failed to generate code suggestions for PR |
|
❌ Gradle check result for 5848b18: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Failed to generate code suggestions for PR |
1 similar comment
|
Failed to generate code suggestions for PR |
|
Failed to generate code suggestions for PR |
|
❌ Gradle check result for 51e63e6: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Failed to generate code suggestions for PR |
Signed-off-by: Mikhail Urmich <m.urmich@jobware.de>
Signed-off-by: Mikhail Urmich <m.urmich@jobware.de>
Signed-off-by: Mikhail Urmich <m.urmich@jobware.de>
extract array parsing as its own function Signed-off-by: Mikhail Urmich <m.urmich@jobware.de>
include and exclude collections must not contain the same entries Signed-off-by: Mikhail Urmich <urmich.m@gmail.com>
The same entry MUST NOT be present in both inludes AND excludes arrays. This leads to ambiguity. Signed-off-by: Mikhail Urmich <m.urmich@jobware.de>
Explicitly defined source object '_source={}' not allowed
Signed-off-by: Mikhail Urmich <m.urmich@jobware.de>
Signed-off-by: Mikhail Urmich <m.urmich@jobware.de>
Signed-off-by: Mikhail Urmich <m.urmich@jobware.de>
Signed-off-by: Mikhail Urmich <urmich.m@gmail.com>
Signed-off-by: Mikhail Urmich <m.urmich@jobware.de>
empty object validation updated to cover all possible cases Signed-off-by: Mikhail Urmich <m.urmich@jobware.de>
toXContent to create valid object Signed-off-by: Mikhail Urmich <urmich.m@gmail.com>
Signed-off-by: Mikhail Urmich <urmich.m@gmail.com>
|
❌ Gradle check result for cabbc32: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
cabbc32 to
fe8b28f
Compare
|
Failed to generate code suggestions for PR |
|
❌ Gradle check result for fe8b28f: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Description
Validation of the
_sourceobject added to avoid confusion and reject contradicting and ambiguous requests:"_source": {}At lease one ofincludesorexcludesmust be defined. 🚫"_source": []Explicitly defined empty array ofincludesis not allowed. 🚫"_source": { "includes": "text", "excludes": ["title", "text"] }Thetextfield is defined in bothincludesandexcludes. Contradiction. 🚫"_source": { "includes": [], "excludes": ["title"] }or_source: { "includes": ["title"], "excludes": [] }Explicitly defined empty arrays are not allowed to avoid confusion. 🚫To include the whole
_sourceobject or to exclude it completely, the existingbooleanlogic is encouraged."_source": trueand"_source": falseUnit tests added to test behaviour of parsing implementation.
Existing unit tests have been extended to cover invalid cases.
Related Issues
Resolves #20612
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.