Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ private boolean isPathParamDefined(String pathParam, List<Parameter> parameters)
return false;
} else {
for (Parameter parameter : parameters) {
if (pathParam.equals(parameter.getName()) && "path".equals(parameter.getIn())) {
if (parameter instanceof RefParameter || (pathParam.equals(parameter.getName()) && "path".equals(parameter.getIn()))) {
return true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public void testIssue111() {
assertNotNull(result.getSwagger());
}

@Test
public void testIssue1146() {
SwaggerDeserializationResult result = new SwaggerParser().readWithInfo("issue-1146.yaml", null, true);
assertEquals(0, result.getMessages().size());
}

@Test
public void testIssueDefinitionWithDots_2() {
Swagger swagger = new SwaggerParser().read("SimpleAPI.yaml");
Expand Down
39 changes: 39 additions & 0 deletions modules/swagger-parser/src/test/resources/issue-1146.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
swagger: "2.0"
info:
description: "Test"
version: "1.0.0"
title: "Swagger v2 example"
termsOfService: "http://swagger.io/terms/"
contact:
email: "apiteam@swagger.io"
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
host: "petstore.swagger.io"
basePath: "/v2"
schemes:
- "https"
- "http"
paths:
/brands/{brand-id}/stations:
get:
tags:
- Brand
summary: Returns a list of the brand's stations
operationId: getBrandStations
parameters:
- $ref: "#/parameters/brand-id"
- in: query
name: available-to-client-only
required: true
type: boolean
responses:
200:
description: OK
parameters:
brand-id:
in: path
description: this is a test
name: brand-id
required: true
type: string