-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jooby-apt: Java strings not escaped properly in mvc source code gener…
…ation. - fix #3455 - shade commons-text + use automatic-module-name
- Loading branch information
Showing
7 changed files
with
101 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Jooby https://jooby.io | ||
* Apache License Version 2.0 https://jooby.io/LICENSE.txt | ||
* Copyright 2014 Edgar Espina | ||
*/ | ||
package tests.i3455; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import io.jooby.annotation.GET; | ||
import io.jooby.annotation.Path; | ||
import io.jooby.annotation.QueryParam; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
@Path("/\"path") | ||
public class C3455 { | ||
@GET("/required\"-string-param") | ||
@Schema(description = "test\"ttttt") | ||
public String requiredStringParam(@QueryParam("value\"") @NonNull String value) { | ||
return value; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
modules/jooby-apt/src/test/java/tests/i3455/Issue3455.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Jooby https://jooby.io | ||
* Apache License Version 2.0 https://jooby.io/LICENSE.txt | ||
* Copyright 2014 Edgar Espina | ||
*/ | ||
package tests.i3455; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.jooby.apt.ProcessorRunner; | ||
|
||
public class Issue3455 { | ||
|
||
@Test | ||
public void shouldEscapeJavaSpecialCharacters() throws Exception { | ||
new ProcessorRunner(new C3455()) | ||
.withRouter( | ||
(app, source) -> { | ||
assertTrue(source.toString().contains("\"/\\\"path/required\\\"-string-param\"")); | ||
assertTrue(source.toString().contains("\"test\\\"ttttt\"")); | ||
assertTrue(source.toString().contains("\"value\\\"\"")); | ||
}); | ||
} | ||
} |