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

Adds processor to annotation JsonAutoDetect #20784

Merged

Conversation

netodevel
Copy link
Contributor

@netodevel netodevel commented Oct 14, 2021

This pr adds the processor to Jackson JsonAutoDetect annotation (currently needed for records usage);

Bug:
This error happens in the endpoint's response serialization (mode native):

Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Failed to access RecordComponents of type `com.netodevel.money_transfer.dto.MoneyTransferResponse`

How to Reproduce?

clone repository
git clone https://github.com/netodevel/money-transfer-service

build native image
mvn clean install -Dnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-native-image:21.2.0-java16 -DskipTests

run postgresql local
docker-compose up -d

execute binary
./target/money-transfer-service-1.0.0-SNAPSHOT-runner

** execute request **
[POST] url: http://localhost:8080/api/money-transfer

{
  "fromAccount": "999",
  "toAccount": "777",
  "amount": 50
}

@quarkus-bot quarkus-bot bot added the area/jackson Issues related to Jackson (JSON library) label Oct 14, 2021
@netodevel netodevel force-pushed the feature/netodevel-jackson-with-records branch from 26e090a to 3367a93 Compare October 14, 2021 22:08
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 15, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 3367a93

Status Name Step Failures Logs Raw logs
JVM Tests - JDK 11 Download Maven Repo ⚠️ Check → Logs Raw logs
✔️ JVM Tests - JDK 17

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small change and this should be good

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 15, 2021

This workflow status is outdated as a new workflow run has been triggered.

Failing Jobs - Building 3a8d65a

Status Name Step Failures Logs Raw logs
Initial JDK 11 Build Build Failures Logs Raw logs

Failures

⚙️ Initial JDK 11 Build #

- Failing: extensions/jackson/deployment 
! Skipped: core/test-extension/deployment devtools/bom-descriptor-json devtools/cli and 337 more

📦 extensions/jackson/deployment

Failed to execute goal net.revelc.code.formatter:formatter-maven-plugin:2.16.0:validate (default) on project quarkus-jackson-deployment: File '/home/runner/work/quarkus/quarkus/extensions/jackson/deployment/src/main/java/io/quarkus/jackson/deployment/JacksonProcessor.java' has not been previously formatted. Please format file and commit before running validation!

@geoand
Copy link
Contributor

geoand commented Oct 15, 2021

You need to format the code

@geoand
Copy link
Contributor

geoand commented Oct 15, 2021

When you are done, please squash the commits

* Fixs imports
* Fixs of code review
* Fixs variable name
* Adds validation if target is a class
* Fixs format the code
@netodevel netodevel force-pushed the feature/netodevel-jackson-with-records branch from cc55789 to 6a58ff9 Compare October 15, 2021 13:06
@netodevel
Copy link
Contributor Author

@geoand, sorry about format :/

I've fixed the formatting and squash, Thanks

@geoand geoand added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Oct 15, 2021
@geoand geoand merged commit aece5fe into quarkusio:main Oct 15, 2021
@quarkus-bot quarkus-bot bot added this to the 2.5 - main milestone Oct 15, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Oct 15, 2021
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants