-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#88 better fix: teach jackson to serialize enums using toString(), wh…
…ich will respect Swagger's ParameterIn and other enums toString() implementation (which is lower-case)
- Loading branch information
1 parent
f59f0c2
commit c366905
Showing
5 changed files
with
31 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
dependencies { | ||
implementation(project(":server")) | ||
api("io.swagger.core.v3:swagger-annotations:2.2.22") | ||
|
||
testImplementation(project(":json")) | ||
testImplementation(project(":jackson")) | ||
} |
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,18 @@ | ||
package klite.openapi | ||
|
||
import ch.tutteli.atrium.api.fluent.en_GB.toEqual | ||
import ch.tutteli.atrium.api.verbs.expect | ||
import io.swagger.v3.oas.annotations.enums.ParameterIn.PATH | ||
import klite.jackson.kliteJsonMapper | ||
import klite.jackson.render | ||
import org.junit.jupiter.api.Test | ||
|
||
class JsonSerializationTest { | ||
@Test fun `ParameterIn serialization using klite-json`() { | ||
expect(klite.json.JsonMapper().render(PATH)).toEqual("\"path\"") | ||
} | ||
|
||
@Test fun `ParameterIn serialization using jackson`() { | ||
expect(kliteJsonMapper().render(PATH)).toEqual("\"path\"") | ||
} | ||
} |