Post request with EntityView as parameter using Quarkus #1613
Unanswered
chrigiansen
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hi there. I didn't look into the code yet, but can you try setting up the JAXRS-Jackson integration please? https://persistence.blazebit.com/documentation/1.6/entity-view/manual/en_US/#jaxrs-setup You shouldn't have to implement custom object mappers. Also take a look into the sample app. Maybe that helps you figure out what is missing already. Please let us all know what your problem was so I can improve the documentation. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
I am currently trying to get my application to update / create entities using an EntityView as parameter.
Unfortunately, I am getting this Exception:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of 'ch.chrigiansen.quarkus.blazebit.rest.view.GiftUpdateView' (no Creators, like default constructor, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information at [Source: (io.quarkus.vertx.http.runtime.VertxInputStream); line: 1, column: 1]
This brought me to the attention of this Quarkus Guide. I did implement such a CustomObjectMapper class, but it is not used as intended.
My implementation looks like this:
I am having two issues:
I guess the issue in my example is, that the returned mapper is only a subset of the EntityViewAwareObjectMapper and therefore not capable of providing a new instance for the json.
I will provide some code to you, which you can run with maven. There are two tests, one for a get that works (for good vibes) and the post test that fails. Could you be so kind as to fix what is missing and provide the code back? Besides actually needing this functionality, I plan on enriching the guide on the Quarkus page and provide code to the repository.
Many thanks in advance
Chrigiansen
Beta Was this translation helpful? Give feedback.
All reactions