Improve error msg when a field name contains only white spaces#27709
Merged
dakrone merged 2 commits intoelastic:masterfrom Dec 8, 2017
Merged
Improve error msg when a field name contains only white spaces#27709dakrone merged 2 commits intoelastic:masterfrom
dakrone merged 2 commits intoelastic:masterfrom
Conversation
white spaces
Collaborator
|
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
Member
|
@elasticmachine test this please |
dakrone
requested changes
Dec 8, 2017
Member
dakrone
left a comment
There was a problem hiding this comment.
I left two comments about the messages
| // check if the field name contains only white spaces | ||
| if (Strings.isEmpty(part) == false) { | ||
| throw new IllegalArgumentException( | ||
| "object field cannot contain only white spaces: ['" + fullFieldPath + "']"); |
Member
There was a problem hiding this comment.
this should be "white spaces" -> "whitespace"
| () -> client().prepareIndex("idx", "type").setSource(bytes, XContentType.JSON).get()); | ||
|
|
||
| assertThat(emptyFieldNameException.getMessage(), containsString( | ||
| "object field cannot contain only white spaces: ['top.aoeu. ']")); |
0029e4a to
92811d5
Compare
Contributor
Author
|
@dakrone thanks! I just modified the msg. |
Member
|
Merged, thanks @olcbean! |
dakrone
pushed a commit
that referenced
this pull request
Dec 8, 2017
* Explicitly check if a field name contains only white spaces * "white spaces" changed to "whitespace"
dakrone
pushed a commit
that referenced
this pull request
Dec 8, 2017
* Explicitly check if a field name contains only white spaces * "white spaces" changed to "whitespace"
jasontedor
added a commit
to jasontedor/elasticsearch
that referenced
this pull request
Dec 9, 2017
* master: Fix index with unknown setting test Remove internal channel tracking in transports (elastic#27711) Improve error msg when a field name contains only white spaces (elastic#27709) Do not open indices with broken settings Set ACK timeout on indices service test Implement byte array reusage in `NioTransport` (elastic#27696) [TEST] Remove leftover ES temp directories before Vagrant tests (elastic#27722) Cleanup split strings by comma method Remove unused import from AliasResolveRoutingIT Add read timeouts to http module (elastic#27713) Fix routing with leading or trailing whitespace remove await fix from FullClusterRestartIT.testRecovery Add missing 's' to tmpdir name (elastic#27721) [Issue-27716]: CONTRIBUTING.md IntelliJ configurations settings are confusing. (elastic#27717) [TEST] Now actually wait for merges
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Till now if a field name is empty or contains only white spaces, the error msg is
object field starting or ending with a [.] makes object resolution ambiguous.This PR explicitly check if the field name contains only white spaces and result in the error
object field cannot contain only white spaces.Fixes #27701
CC @danielmitterdorfer @dakrone