diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java index fefd6e6a276c6..3c6216eed76ed 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/yaml/restspec/ClientYamlSuiteRestApiParser.java @@ -70,11 +70,16 @@ public ClientYamlSuiteRestApi parse(String location, XContentParser parser) thro } if (parser.currentToken() == XContentParser.Token.START_ARRAY && "paths".equals(currentFieldName)) { while (parser.nextToken() == XContentParser.Token.VALUE_STRING) { - String path = parser.text(); - if (restApi.getPaths().contains(path)) { - throw new IllegalArgumentException("Found duplicate path [" + path + "]"); + addPathToApi(parser.text(), restApi); + } + } + if (parser.currentToken() == XContentParser.Token.START_ARRAY && "deprecated_paths".equals(currentFieldName)) { + while (parser.nextToken() != XContentParser.Token.END_ARRAY) { + if (parser.currentToken() == XContentParser.Token.FIELD_NAME && "path".equals(parser.currentName())) + { + parser.nextToken(); + addPathToApi(parser.text(), restApi); } - restApi.addPath(path); } } @@ -142,6 +147,13 @@ public ClientYamlSuiteRestApi parse(String location, XContentParser parser) thro return restApi; } + private void addPathToApi(String path, ClientYamlSuiteRestApi restApi) { + if (restApi.getPaths().contains(path)) { + throw new IllegalArgumentException("Found duplicate path [" + path + "]"); + } + restApi.addPath(path); + } + private static class Parameter { private boolean required; public boolean isRequired() {