Skip to content
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

Jackson: also detect class referenced by @JsonTypeIdResolver #27346

Closed
snazy opened this issue Aug 17, 2022 · 3 comments · Fixed by #27357
Closed

Jackson: also detect class referenced by @JsonTypeIdResolver #27346

snazy opened this issue Aug 17, 2022 · 3 comments · Fixed by #27357
Labels
area/jackson Issues related to Jackson (JSON library) kind/bug Something isn't working
Milestone

Comments

@snazy
Copy link
Contributor

snazy commented Aug 17, 2022

Describe the bug

io.quarkus.jackson.deployment.JacksonProcessor detects the classes referenced by e.g. @JsonSerialize, @JsonDeserialize, but it doesn't handle classes referenced by @JsonTypeIdResolver annotations.

It seems that "just handling" the value of JsonTypeIdResolver.value() like JsonDeserialize.using() should fix this.

Could someone quickly cross-check whether my assumption sounds legit? Happy to provide a PR with the described change to fix this issue.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@snazy snazy added the kind/bug Something isn't working label Aug 17, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 17, 2022

/cc @geoand, @gsmet

@quarkus-bot quarkus-bot bot added the area/jackson Issues related to Jackson (JSON library) label Aug 17, 2022
@gsmet
Copy link
Member

gsmet commented Aug 17, 2022

@snazy yes, it makes perfect sense.

snazy added a commit to snazy/quarkus that referenced this issue Aug 18, 2022
Adds missing support for classes referenced by `@JsonTypeIdResolver`,
which is expecially important when using native builds.

Fixes quarkusio#27346
snazy added a commit to snazy/quarkus that referenced this issue Aug 18, 2022
Adds missing support for classes referenced by `@JsonTypeIdResolver`, which is particularly important when using native builds.

The added integration tests are likely only meaningful when run in native mode (`-Pnative`), otherwise "good old Java reflection" does its job.

Fixes quarkusio#27346
snazy added a commit to snazy/quarkus that referenced this issue Aug 18, 2022
Adds missing support for classes referenced by `@JsonTypeIdResolver`, which is particularly important when using native builds.

The added integration tests are likely only meaningful when run in native mode (`-Pnative`), otherwise "good old Java reflection" does its job.

Fixes quarkusio#27346
@snazy
Copy link
Contributor Author

snazy commented Aug 18, 2022

@gsmet created the PR

@quarkus-bot quarkus-bot bot added this to the 2.13 - main milestone Aug 22, 2022
sheilamjones pushed a commit to sheilamjones/quarkus that referenced this issue Aug 22, 2022
Adds missing support for classes referenced by `@JsonTypeIdResolver`, which is particularly important when using native builds.

The added integration tests are likely only meaningful when run in native mode (`-Pnative`), otherwise "good old Java reflection" does its job.

Fixes quarkusio#27346
@gsmet gsmet modified the milestones: 2.13 - main, 2.12.0.Final Aug 23, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Aug 23, 2022
Adds missing support for classes referenced by `@JsonTypeIdResolver`, which is particularly important when using native builds.

The added integration tests are likely only meaningful when run in native mode (`-Pnative`), otherwise "good old Java reflection" does its job.

Fixes quarkusio#27346

(cherry picked from commit e4e0d4e)
fercomunello pushed a commit to fercomunello/quarkus that referenced this issue Aug 31, 2022
Adds missing support for classes referenced by `@JsonTypeIdResolver`, which is particularly important when using native builds.

The added integration tests are likely only meaningful when run in native mode (`-Pnative`), otherwise "good old Java reflection" does its job.

Fixes quarkusio#27346
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/jackson Issues related to Jackson (JSON library) kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants