Skip to content

Commit a1fb1b0

Browse files
committed
Fix incorrect path separators when resolving schema ref on Windows OS - test case
1 parent 03f0809 commit a1fb1b0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIV3ParserTest.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3269,4 +3269,20 @@ public void test31SafeURLResolvingWithLocalhost() {
32693269
}
32703270
}
32713271
}
3272+
3273+
@Test
3274+
public void testIssue1886() {
3275+
ParseOptions options = new ParseOptions();
3276+
options.setResolve(true);
3277+
options.setFlatten(true);
3278+
OpenAPIV3Parser openApiParser = new OpenAPIV3Parser();
3279+
SwaggerParseResult parseResult = openApiParser.readLocation("issue-1886/openapi.yaml", null, options);
3280+
OpenAPI openAPI = parseResult.getOpenAPI();
3281+
assertEqualsNoOrder(
3282+
openAPI.getComponents().getSchemas().keySet(),
3283+
Arrays.asList("ArrayPojo", "Enum1", "Enum1_1", "Enum2", "Enum3", "MapPojo", "SetPojo", "SimplePojo",
3284+
"TransactionsPatchRequestBody", "additional-properties", "array-pojo", "locale-translation-item",
3285+
"map-pojo", "set-pojo", "simple-pojo", "translation-item")
3286+
);
3287+
}
32723288
}

0 commit comments

Comments
 (0)