Scripting: fill in get contexts REST API (#48319) (#48602)
Updates response for `GET /_script_context`, returning a `contexts`
object with a list of context description objects. The description
includes the context name and a list of methods available. The
methods list has the signature for the `execute` mathod and any
getters. eg.
```
{
"contexts": [
{
"name" : "moving-function",
"methods" : [
{
"name" : "execute",
"return_type" : "double",
"params" : [
{
"type" : "java.util.Map",
"name" : "params"
},
{
"type" : "double[]",
"name" : "values"
}
]
}
]
},
{
"name" : "number_sort",
"methods" : [
{
"name" : "execute",
"return_type" : "double",
"params" : [ ]
},
{
"name" : "getDoc",
"return_type" : "java.util.Map",
"params" : [ ]
},
{
"name" : "getParams",
"return_type" : "java.util.Map",
"params" : [ ]
},
{
"name" : "get_score",
"return_type" : "double",
"params" : [ ]
}
]
},
...
]
}
```
fixes: #47411