- edited description
Request validation fails if there are multiple servers in the specification with different path
Issue #385
new
If the specification contains multiple servers and the path of the servers are different, then the request which is sent to the second server fails. The validator always takes the path of the first server.
servers:
- url: 'https://test.com/path'
- url: 'https://test.com/alternative-path'
Only the first test passes.
@Test
public void validate_withTheFirstServer_shouldSucceed() {
final Request request = SimpleRequest.Builder
.get("/path/users")
.build();
assertPass(classUnderTest.validateRequest(request));
}
@Test
public void validate_withTheSecondServer_shouldSucceed() {
final Request request = SimpleRequest.Builder
.get("/alternative-path/users")
.build();
assertPass(classUnderTest.validateRequest(request));
}
{
"key" : "validation.request.path.missing",
"level" : "ERROR",
"message" : "No API path found that matches request '/alternative-path/users'.",
"context" : {
"requestPath" : "/alternative-path/users",
"requestMethod" : "GET"
}
}
Comments (1)
-
reporter - Log in to comment