-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Consistent apis: GET part #4710
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
Consistent apis: GET part #4710
Conversation
XContentBuilder builder = RestXContentBuilder.restContentBuilder(request); | ||
builder.startObject(); | ||
for (ObjectObjectCursor<String, Settings> cursor : getSettingsResponse.getIndexToSettings()) { | ||
// no settings, jump over it to shorten the response data | ||
if (cursor.value.getAsMap().size() == 0) { |
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.
maybe getAsMap().isEmtpy()
?
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.
fixed
I think this is close - @clintongormley can you look at it please! |
return this; | ||
} | ||
|
||
@Override | ||
public ActionRequestValidationException validate() { | ||
return null; | ||
ActionRequestValidationException validationException = null; |
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.
cool looks good!
This looks good to me, +1 |
left some minor comments |
* Made GET mappings consistent, supporting * /{index}/_mappings/{type} * /{index}/_mapping/{type} * /_mapping/{type} * Added "mappings" in the JSON response to align it with other responses * Made GET warmers consistent, support /{index}/_warmers/{type} and /_warmer, /_warner/{name} as well as wildcards and _all notation * Made GET aliases consistent, support /{index}/_aliases/{name} and /_alias, /_aliases/{name} as well as wildcards and _all notation * Made GET settings consistent, added /{index}/_setting/{name}, /_settings/{name} as well as supportings wildcards in settings name * Returning empty JSON instead of a 404, if a specific warmer/ setting/alias/type is missing * Added a ton of spec tests for all of the above * Added a couple of more integration tests for several features Relates elastic#4071
In order to make some our APIs consistent, ticket #4071 has been created.
This PR (not yet rebase, will do after review) takes care of streamlining the GET APIs