diff --git a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/ClasspathHelper.java b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/ClasspathHelper.java index 88ac9e49c1..7bec611332 100644 --- a/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/ClasspathHelper.java +++ b/modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/ClasspathHelper.java @@ -13,7 +13,7 @@ public static String loadFileFromClasspath(String location) { String file = FilenameUtils.separatorsToUnix(location); InputStream inputStream = ClasspathHelper.class.getResourceAsStream(file); - + if(inputStream == null) { inputStream = ClasspathHelper.class.getClassLoader().getResourceAsStream(file); } @@ -22,6 +22,10 @@ public static String loadFileFromClasspath(String location) { inputStream = ClassLoader.getSystemResourceAsStream(file); } + if(inputStream == null) { + inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(file); + } + if(inputStream != null) { try { return IOUtils.toString(inputStream);