Skip to content

Commit 2ade4ad

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

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
@@ -162,7 +162,7 @@ private String buildJsBundleUrl(String requestUrl, String scalarPath) {
162162
* @return the api docs url
163163
*/
164164
private String buildApiDocsUrl(String requestUrl, String apiDocsPath) {
165-
String apiDocsUrl = scalarProperties.getUrl();
165+
String apiDocsUrl = originalScalarUrl;
166166
if (SCALAR_DEFAULT_URL.equals(originalScalarUrl)) {
167167
String serverUrl = requestUrl.substring(0, requestUrl.length() - scalarProperties.getPath().length());
168168
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)