Skip to content

Commit b74452a

Browse files
committed
Scalar source URLs resolve to "null/<groupName>" on second request when using GroupedOpenApi fixes #3230
1 parent da1d8b1 commit b74452a

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

springdoc-openapi-starter-common/src/main/java/org/springdoc/scalar/AbstractScalarController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ private String buildJsBundleUrl(String requestUrl, String scalarPath) {
167167
* @return the api docs url
168168
*/
169169
private String buildApiDocsUrl(String requestUrl, String apiDocsPath) {
170-
String apiDocsUrl = scalarProperties.getUrl();
170+
String apiDocsUrl = originalScalarUrl;
171171
if (SCALAR_DEFAULT_URL.equals(originalScalarUrl)) {
172172
String serverUrl = requestUrl.substring(0, requestUrl.length() - scalarProperties.getPath().length());
173173
apiDocsUrl = serverUrl + apiDocsPath;

springdoc-openapi-starter-webmvc-scalar/src/test/java/test/org/springdoc/webmvc/scalar/app5/SpringDocApp5Test.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ public class SpringDocApp5Test extends AbstractCommonTest {
3434
@Test
3535
void checkContent() throws Exception {
3636
checkContent(SCALAR_DEFAULT_PATH);
37+
checkContent(SCALAR_DEFAULT_PATH);
3738
}
3839
}

0 commit comments

Comments
 (0)