Sync the API definition for put_script with the docs#25736
Sync the API definition for put_script with the docs#25736honzakral wants to merge 1 commit intoelastic:5.6from
Conversation
|
@martijnvg Please correct me if I'm wrong here, but I believe this cannot be changed since the url paths much match based on the parameter number. See the explanation in the comment here (https://github.com/elastic/elasticsearch/blob/master/core/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutStoredScriptAction.java) on line 40. I don't really know how to resolve the fact that the documentation is generated from this file as well. |
|
I think for 5.x we should keep the lang parameter as it is still handled on the ES side? |
|
@honzakral @martijnvg The problem is there are two paths in 5.x which is confusing /{lang} and /{lang}/{id} where in the first path lang actually means id. Nothing can easily be done about this, however, and it is gone in 6.0, so I think this should probably be closed. |
|
At that point we arrive at the theoretical question - what does the api spec and the accompanying yaml tests model? The internal java implementation, or the API? The api is quite clear - if only one argument is given, it is interpreted as |
It is of immense consequence to the actual implementation of how the rest test runner works. As @jdconrad explained, the spec handling by the test runner expects variations like this to be appending new spec variables, not modifying existing ones. I don't think this is worthwhile to try to fix in 5.x. I think we should just live with it until 6.0 is released. |
|
btw, putting a script with the lang in the URL does not work on 5.x today. This works: This doesn't work: Instead it returns: I couldn't figure out the correct syntax to make it work with the lang in the URL. |
|
This is the format that is accepted: |
|
jenkins, please test this |
|
tl;dr:
details: |
|
@honzakral is this still relevant? |
|
It is not, in |
According to the docs (0) the
langportion of the URL is not required, also it only 1 parameter is supplied, it should be theid, notlang.0 - https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting-using.html#_request_examples