-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump Jackson to 2.15.2 #33762
Closed
Closed
Bump Jackson to 2.15.2 #33762
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c543cfe
set jackson-bom version to 2.15.2
KaiSuchomel 9b9379e
created Test to verify Bug in jackson 2.15.0 regarding record Seriali…
KaiSuchomel c4fa94e
Merge branch 'main' into main
KaiSuchomel aac91f4
reset maven.compiler settings to 11
KaiSuchomel e89371a
Merge branch 'main' into main
KaiSuchomel b8fe3e1
removed Record Tests (record) is not available
KaiSuchomel 2ca79cc
removed JacksonConfiguration
KaiSuchomel 6dff573
Merge branch 'main' into main
KaiSuchomel 959c15c
Merge branch 'main' into main
KaiSuchomel 3706629
Merge branch 'main' into main
KaiSuchomel 85af144
Merge branch 'main' of github.com:KaiSuchomel/quarkus
KaiSuchomel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 8 additions & 0 deletions
8
...n-tests/resteasy-jackson/src/main/java/io/quarkus/it/resteasy/jackson/GreetingRecord.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,8 @@ | ||
package io.quarkus.it.resteasy.jackson; | ||
|
||
import java.sql.Date; | ||
import java.time.LocalDate; | ||
|
||
public record GreetingRecord(String message, LocalDate date, Date sqlDate) { | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...resteasy-jackson/src/main/java/io/quarkus/it/resteasy/jackson/GreetingRecordResource.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,17 @@ | ||
package io.quarkus.it.resteasy.jackson; | ||
|
||
import java.sql.Date; | ||
import java.time.LocalDate; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
|
||
@Path("/greetingRecord") | ||
public class GreetingRecordResource { | ||
|
||
@GET | ||
public GreetingRecord hello() { | ||
LocalDate localDate = LocalDate.of(2019, 01, 01); | ||
return new GreetingRecord("hello", localDate, new Date(localDate.toEpochDay())); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...s/resteasy-jackson/src/main/java/io/quarkus/it/resteasy/jackson/JacksonConfiguration.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,22 @@ | ||
package io.quarkus.it.resteasy.jackson; | ||
|
||
import jakarta.inject.Singleton; | ||
|
||
import com.fasterxml.jackson.annotation.JsonAutoDetect; | ||
import com.fasterxml.jackson.annotation.PropertyAccessor; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
import io.quarkus.jackson.ObjectMapperCustomizer; | ||
|
||
@Singleton | ||
public class JacksonConfiguration implements ObjectMapperCustomizer { | ||
|
||
@Override | ||
public void customize(ObjectMapper mapper) { | ||
mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY); | ||
mapper.setVisibility(PropertyAccessor.GETTER, JsonAutoDetect.Visibility.NONE); | ||
mapper.setVisibility(PropertyAccessor.SETTER, JsonAutoDetect.Visibility.ANY); | ||
mapper.setVisibility(PropertyAccessor.CREATOR, JsonAutoDetect.Visibility.NONE); | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...easy-jackson/src/test/java/io/quarkus/it/resteasy/jackson/GreetingRecordResourceTest.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,23 @@ | ||
package io.quarkus.it.resteasy.jackson; | ||
|
||
import static io.restassured.RestAssured.given; | ||
import static org.hamcrest.CoreMatchers.containsString; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import io.quarkus.test.junit.QuarkusTest; | ||
|
||
@QuarkusTest | ||
class GreetingRecordResourceTest { | ||
|
||
@Test | ||
void testEndpoint() { | ||
given() | ||
.when().get("/greetingRecord") | ||
.then() | ||
.statusCode(200) | ||
.body(containsString("hello")) | ||
.body(containsString("2019-01-01")); | ||
} | ||
|
||
} |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We definitely don't want this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to get my Test using "record" running. Is there another way to enable Java version with "record"??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say let's remove the test altogether as it's not a Quarkus issue, it's a Jackson issue so we should not be testing for it (unless we have some problematic integration point)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a plan to update the maven.compiler settings to a newer version than 11?
So far i will remove the Test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No.
But for Java 17 specific things, we do have a dedicated integration test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, where can i find these dedicated Tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it’s a Jackson bug, I don’t think we need a test in our code base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, than next time we need to check again manually...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we were to add such tests, we would need to add them for every feature under the sun, that just isn't practical.
What we do test extensively is our integration points with the various libraries and our workarounds for known problems.
The Jackson problem you linked to is neither - but of course we do want to bump to the latest Jackson version.