Skip to content

Commit

Permalink
fixes #278 overwrite the basePath from handler.yml if it is not null (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehu committed Jan 26, 2023
1 parent d90d58e commit 695186f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ public OpenApiHandler(OpenApiHandlerConfig cfg) {

helper = new OpenApiHelper(Config.getInstance().getMapper().writeValueAsString(openapi));

// overwrite the helper.basePath it cannot be derived from the openapi.yaml from the handler.yml
if (helper.basePath.isEmpty() && handlerConfig != null) {
// overwrite the helper.basePath if it cannot be derived from the openapi.yaml from the handler.yml
// if the basePath is not null. The default value if openapi.yml doesn't have basePath is "".
if (helper.basePath.isEmpty() && handlerConfig != null && handlerConfig.getBasePath() != null) {
helper.setBasePath(handlerConfig.getBasePath());
}

} catch (JsonProcessingException e) {
logger.error("merge specification failed");
throw new RuntimeException("merge specification failed");
Expand Down

0 comments on commit 695186f

Please sign in to comment.