From 9eea1b68339c19ef1563e8adda26d081e227e9a9 Mon Sep 17 00:00:00 2001 From: Alexander Kazakov Date: Thu, 16 Jun 2016 17:03:51 +0300 Subject: [PATCH] Fix flat_settings REST parameter * Get XContent params from request in Nodes rest actions * Adding test for nodes info rest api --- .../rest/action/support/RestActions.java | 2 +- .../test/nodes.info/30_settings.yaml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 rest-api-spec/src/main/resources/rest-api-spec/test/nodes.info/30_settings.yaml diff --git a/core/src/main/java/org/elasticsearch/rest/action/support/RestActions.java b/core/src/main/java/org/elasticsearch/rest/action/support/RestActions.java index 51d5089ec6f..66998ee8727 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/support/RestActions.java +++ b/core/src/main/java/org/elasticsearch/rest/action/support/RestActions.java @@ -275,7 +275,7 @@ public class RestActions { @Override public RestResponse buildResponse(NodesResponse response, XContentBuilder builder) throws Exception { - return RestActions.nodesResponse(builder, ToXContent.EMPTY_PARAMS, response); + return RestActions.nodesResponse(builder, channel.request(), response); } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/nodes.info/30_settings.yaml b/rest-api-spec/src/main/resources/rest-api-spec/test/nodes.info/30_settings.yaml new file mode 100644 index 00000000000..a63c246b603 --- /dev/null +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/nodes.info/30_settings.yaml @@ -0,0 +1,19 @@ +--- +"node_info test flat_settings": + - do: + cluster.state: {} + + - set: { master_node: master } + + - do: + nodes.info: + metric: [ settings ] + + - match : { nodes.$master.settings.client.type: node } + + - do: + nodes.info: + metric: [ settings ] + flat_settings: true + + - match : { nodes.$master.settings.client\.type: node }