-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add parsing from xContent to ShardSearchFailure #22699
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
Add parsing from xContent to ShardSearchFailure #22699
Conversation
javanna
left a comment
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.
left a nit, LGTM
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.
shall we rather use assertToXContentEquivalent ? I am always cautious on comparing json strings (keys ordering etc.) but maybe in this case it's ok
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.
I think in the toXContent tests that are more a way of checking the intended output is as expected (and more to show a simple, fixed example output in the tests), string comparrison is more intuitive and shouldn't break. We also do this in the other toXContent tests, so I will leave this also to stay consistent.
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.
no objections :)
tlrx
left a comment
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.
I left a minor comment in tests, otherwise LGTM
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.
Why not assertEquals(XContentParser.Token.START_OBJECT, parser.nextToken()); ?
In preparation for being able to parse SearchResponse from its rest representation, this adds fromXContent to ShardSearchFailure.
b5a143d to
fc6113b
Compare
In preparation for being able to parse SearchResponse from its rest representation, this adds fromXContent to ShardSearchFailure.
In preparation for being able to parse SearchResponse from its rest
representation, this adds fromXContent to ShardSearchFailure.