Skip to content

Commit

Permalink
construct the debug path correctly with and without swaggerBase
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Tam committed Jan 6, 2020
1 parent 9d2db94 commit b6a978f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/java/io/swagger/oas/inflector/OpenAPIInflector.java
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,17 @@ protected void init(Configuration configuration) {
}
}
final Resource.Builder builder = Resource.builder();
builder.path(basePath(originalBasePath, config.getSwaggerBase() + "debug.json"))
String debugPath;

if(config.getSwaggerBase().endsWith("/")) {
debugPath = basePath(originalBasePath, config.getSwaggerBase() + "debug.json");
}
else {
debugPath = basePath(originalBasePath, config.getSwaggerBase() + "/debug.json");
}

LOGGER.debug("using debug path: `" + debugPath + "`");
builder.path(debugPath)
.addMethod(HttpMethod.GET)
.produces(MediaType.APPLICATION_JSON)
.handledBy(new InflectResultController(result))
Expand Down

0 comments on commit b6a978f

Please sign in to comment.