diff --git a/modules/swagger-parser/src/test/java/io/swagger/parser/FileReferenceTests.java b/modules/swagger-parser/src/test/java/io/swagger/parser/FileReferenceTests.java index c83e8f0579..a662955e0d 100644 --- a/modules/swagger-parser/src/test/java/io/swagger/parser/FileReferenceTests.java +++ b/modules/swagger-parser/src/test/java/io/swagger/parser/FileReferenceTests.java @@ -120,4 +120,13 @@ public void testIssue323() { assertNotNull(swagger.getDefinitions().get("Paging")); assertNotNull(swagger.getDefinitions().get("Foobar")); } + + @Test + public void testIssue289() { + SwaggerDeserializationResult result = new SwaggerParser().readWithInfo("./src/test/resources/issue-289.yaml", null, true); + assertNotNull(result.getSwagger()); + + Swagger swagger = result.getSwagger(); + assertNotNull(swagger.getPath("/foo").getGet()); + } } diff --git a/modules/swagger-parser/src/test/resources/issue-289-b.yaml b/modules/swagger-parser/src/test/resources/issue-289-b.yaml new file mode 100644 index 0000000000..4e12bc75f4 --- /dev/null +++ b/modules/swagger-parser/src/test/resources/issue-289-b.yaml @@ -0,0 +1,12 @@ +swagger: "2.0" + +info: + version: 1.0.0 + title: Path include test case child + +paths: + /foo: + get: + responses: + 200: + description: "Request successful" \ No newline at end of file diff --git a/modules/swagger-parser/src/test/resources/issue-289.yaml b/modules/swagger-parser/src/test/resources/issue-289.yaml new file mode 100644 index 0000000000..76f614ca6d --- /dev/null +++ b/modules/swagger-parser/src/test/resources/issue-289.yaml @@ -0,0 +1,9 @@ +swagger: "2.0" + +info: + version: 1.0.0 + title: Path include test case + +paths: + /foo: + $ref: './issue-289-b.yaml#/paths/~1foo' \ No newline at end of file