From bb013c60b5aeee1da61313e9f3afd64d6ad3eeb5 Mon Sep 17 00:00:00 2001 From: olcbean Date: Fri, 13 Oct 2017 20:20:34 +0200 Subject: [PATCH] Fix inconsistencies in the rest api specs for *_script (#26971) --- .../rest/action/admin/cluster/RestPutStoredScriptAction.java | 1 + .../src/main/resources/rest-api-spec/api/delete_script.json | 5 ----- .../src/main/resources/rest-api-spec/api/get_script.json | 5 ----- .../src/main/resources/rest-api-spec/api/put_script.json | 5 ++--- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutStoredScriptAction.java b/core/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutStoredScriptAction.java index 2ad2db2964d..27083503195 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutStoredScriptAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutStoredScriptAction.java @@ -41,6 +41,7 @@ public class RestPutStoredScriptAction extends BaseRestHandler { controller.registerHandler(POST, "/_scripts/{id}", this); controller.registerHandler(PUT, "/_scripts/{id}", this); + controller.registerHandler(POST, "/_scripts/{id}/{context}", this); controller.registerHandler(PUT, "/_scripts/{id}/{context}", this); } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json b/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json index c61aecd6bb2..83bb690cc04 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/delete_script.json @@ -10,11 +10,6 @@ "type" : "string", "description" : "Script ID", "required" : true - }, - "lang" : { - "type" : "string", - "description" : "Script language", - "required" : true } }, "params" : { diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json b/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json index 1bdc546ad03..2240f0e1a0b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/get_script.json @@ -10,11 +10,6 @@ "type" : "string", "description" : "Script ID", "required" : true - }, - "lang" : { - "type" : "string", - "description" : "Script language", - "required" : true } }, "params" : { diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/put_script.json b/rest-api-spec/src/main/resources/rest-api-spec/api/put_script.json index 45b97f9f285..34bd4f63c28 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/put_script.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/put_script.json @@ -11,10 +11,9 @@ "description" : "Script ID", "required" : true }, - "lang" : { + "context" : { "type" : "string", - "description" : "Script language", - "required" : true + "description" : "Script context" } }, "params" : {