What is likely happening is that your type has `@JsonTypeInfo` annotation which enables polymorphic handling (and if not declared on POJO, maybe via mix-in annotations?), and for that some type of type id is absolutely required. Question, then, is why POJO type has that annotation. Alternative possibility is that `ObjectMapper` has its `enableDefaultTyping()` called, which effectively does the same as adding `@JsonTypeInfo` on most POJO types (depending on which exact method variant was called).
I don't know if Lombok could be doing post-processing to add that annotation? If you can, have a look at what kind of changes it makes to class declaration. -+Tatu +- On Fri, Oct 5, 2018 at 9:28 AM Érick Rocha <[email protected]> wrote: > > I'm using jackson 2.9.6 embedded in spring-boot 2.0.5 and I try to access a > restfull endpoint and when I send a json with @class value, jackson can > deserialize my json > { > "@class": "br.com.adtsys.ciee.auth.user.data.request.LoginRequest", > "username": "000001", > "password": "adminciee2017" > } > > if a remove @class property and value > { > "username": "000001", > "password": "adminciee2017" > } > > jackson can't deserialize my JSON and throws a InvalidTypeIdException, I have > been working with jackson for years and never I saw like thaht before. > > my java obejct is a simple pojo > > public class Login { > private String username; > private String password; > } > > I'm using lombok too. > Someone knows what's happens and why? > > -- > You received this message because you are subscribed to the Google Groups > "jackson-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "jackson-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
