Description
I noticed recently that the v2 Solr API's rename-core command fails to parse out the provided "to" parameter (which contains the desired new core name).
_introspect shows the following documentation for the API:
"rename":{ "type":"object", "documentation":"https://lucene.apache.org/solr/guide/coreadmin-api.html#coreadmin-rename", "description":"Change the name of a core.", "properties":{ "to":{ "type":"string", "description":"The new name for the core."}, "async":{ "type":"string", "description":"Defines a request ID that can be used to track this action after it's submitted. The action will be processed asynchronously when this is defined."}}, "required":["to"]},
but it appears that the underlying code fails to parse out the "to" parameter:
➜ solr git:(master) ✗ curl -ilk -X POST "$SOLR_HOST/api/cores/foo" -d '{"rename": {"to":"bar"}}' HTTP/1.1 400 Bad Request Content-Type: application/json;charset=utf-8 Content-Length: 381 { "responseHeader":{ "status":400, "QTime":0}, "error":{ "metadata":[ "error-class","org.apache.solr.common.SolrException", "root-error-class","org.apache.solr.common.SolrException"], "msg":"Invalid core: [null]. core names must consist entirely of periods, underscores, hyphens, and alphanumerics as well not start with a hyphen", "code":400}}
I'm not super familiar with the V2<->V1 API mapping code, but it looks like the underlying implementation in CoreAdminOperation is expecting a parameter named "other", but there's no mapping from "to" -> "other" for this particular API.