Skip to content

Commit

Permalink
Add support for swagger-ui.url property
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Schuetze committed Mar 31, 2023
1 parent 3c34e5f commit c5e09d8
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ protected String overwriteSwaggerDefaultUrl(String html) {
return html.replace(Constants.SWAGGER_UI_DEFAULT_URL, StringUtils.EMPTY);
}

/**
* Setting the url configured with swagger ui properties
*
* @param html
* @return modifed html
*/
protected String setConfiguredApiDocsUrl(String html){
return html.replace(Constants.SWAGGER_UI_DEFAULT_URL, swaggerUiConfig.getUrl());
}

/**
* Default transformations string.
*
Expand Down Expand Up @@ -167,6 +177,10 @@ else if (swaggerUiConfig.getCsrf().isUseSessionStorage())
if (swaggerUiConfig.isDisableSwaggerDefaultUrl())
html = overwriteSwaggerDefaultUrl(html);

if(StringUtils.isNotEmpty(swaggerUiConfig.getUrl())){
html = setConfiguredApiDocsUrl(html);
}

return html;
}

Expand Down

0 comments on commit c5e09d8

Please sign in to comment.