Allow leading `/` in AUTOSENSE path

Relates to #18160
This commit is contained in:
Nik Everett 2016-05-06 09:09:06 -04:00
parent e90d00ffce
commit cb40b986d1
2 changed files with 3 additions and 5 deletions

View File

@ -176,10 +176,8 @@ public class RestTestsFromSnippetsTask extends SnippetsTask {
String body = matcher.group("body")
String catchPart = last ? snippet.catchPart : null
if (pathAndQuery.startsWith('/')) {
// Why not do some light linting while we're here?
throw new InvalidUserDataException(
"Path shouldn't start with a '/': $snippet\n"
+ snippet.contents)
// Leading '/'s break the generated paths
pathAndQuery = pathAndQuery.substring(1)
}
emitDo(method, pathAndQuery, body, catchPart)
}

View File

@ -41,7 +41,7 @@ in the field mapping, as follows:
[source,js]
--------------------------------------------------
PUT my_index
PUT /my_index
{
"mappings": {
"my_type": {