Jackson registerSubtypes not working in KotlinJackson with JSON: Unrecognized field, not marked as ignorableIgnoring new fields on JSON objects using JacksonHow to use Jackson to deserialise an array of objectsHow to tell Jackson to ignore a field during serialization if its value is null?Jackson: using builder with nondefault constructorHow to prevent jackson instantiating new object in deserializationHow do you make Jackson use Kotlin default params for missing values?How to parse JSON in Kotlin?Jackson, deserialize class with private fields and arg-constructor without annotationsUse spring's objectmapper with kotlin fuel
Why are on-board computers allowed to change controls without notifying the pilots?
The plural of 'stomach"
Valid Badminton Score?
Is there any reason not to eat food that's been dropped on the surface of the moon?
Can a monster with multiattack use this ability if they are missing a limb?
How can I replace every global instance of "x[2]" with "x_2"
Is the destination of a commercial flight important for the pilot?
How will losing mobility of one hand affect my career as a programmer?
Is it okay / does it make sense for another player to join a running game of Munchkin?
Is there an Impartial Brexit Deal comparison site?
Failed to fetch jessie backports repository
Why Were Madagascar and New Zealand Discovered So Late?
Personal Teleportation as a Weapon
Is there a problem with hiding "forgot password" until it's needed?
Have I saved too much for retirement so far?
voltage of sounds of mp3files
How to prove that the query oracle is unitary?
Can criminal fraud exist without damages?
Opposite of a diet
Your magic is very sketchy
HashMap containsKey() returns false although hashCode() and equals() are true
What would happen if the UK refused to take part in EU Parliamentary elections?
Do I need a multiple entry visa for a trip UK -> Sweden -> UK?
How can I use the arrow sign in my bash prompt?
Jackson registerSubtypes not working in Kotlin
Jackson with JSON: Unrecognized field, not marked as ignorableIgnoring new fields on JSON objects using JacksonHow to use Jackson to deserialise an array of objectsHow to tell Jackson to ignore a field during serialization if its value is null?Jackson: using builder with nondefault constructorHow to prevent jackson instantiating new object in deserializationHow do you make Jackson use Kotlin default params for missing values?How to parse JSON in Kotlin?Jackson, deserialize class with private fields and arg-constructor without annotationsUse spring's objectmapper with kotlin fuel
I was trying to use the registerSubtypes function from Jackson following this tutorial.
So I've converted this code into Kotlin like so:
interface Vehicle
val name: String
class Car @JsonCreator constructor(@JsonProperty("name") override val name: String) : Vehicle
class Truck @JsonCreator constructor(@JsonProperty("name") override val name: String) : Vehicle
class Vehicles @JsonCreator constructor(@JsonProperty("vehicles") var vehicles: List<Vehicle>)
fun main()
val MAPPER = jacksonObjectMapper()
MAPPER.registerSubtypes(NamedType(Truck::class.java, "Truck"))
MAPPER.registerSubtypes(NamedType(Car::class.java, "Car"))
val vehicles = Vehicles(listOf(Car("Dodge"), Truck("Scania")))
val json = MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(vehicles)
println(json)
But the output result is the following:
"vehicles" : [
"name" : "Dodge"
,
"name" : "Scania"
]
It doesn't contain the "@type" field, so deserialization doesn't work.
Any idea how to fix it?
Jackson Kotlin version: 2.9.6
json kotlin jackson jackson2
add a comment |
I was trying to use the registerSubtypes function from Jackson following this tutorial.
So I've converted this code into Kotlin like so:
interface Vehicle
val name: String
class Car @JsonCreator constructor(@JsonProperty("name") override val name: String) : Vehicle
class Truck @JsonCreator constructor(@JsonProperty("name") override val name: String) : Vehicle
class Vehicles @JsonCreator constructor(@JsonProperty("vehicles") var vehicles: List<Vehicle>)
fun main()
val MAPPER = jacksonObjectMapper()
MAPPER.registerSubtypes(NamedType(Truck::class.java, "Truck"))
MAPPER.registerSubtypes(NamedType(Car::class.java, "Car"))
val vehicles = Vehicles(listOf(Car("Dodge"), Truck("Scania")))
val json = MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(vehicles)
println(json)
But the output result is the following:
"vehicles" : [
"name" : "Dodge"
,
"name" : "Scania"
]
It doesn't contain the "@type" field, so deserialization doesn't work.
Any idea how to fix it?
Jackson Kotlin version: 2.9.6
json kotlin jackson jackson2
add a comment |
I was trying to use the registerSubtypes function from Jackson following this tutorial.
So I've converted this code into Kotlin like so:
interface Vehicle
val name: String
class Car @JsonCreator constructor(@JsonProperty("name") override val name: String) : Vehicle
class Truck @JsonCreator constructor(@JsonProperty("name") override val name: String) : Vehicle
class Vehicles @JsonCreator constructor(@JsonProperty("vehicles") var vehicles: List<Vehicle>)
fun main()
val MAPPER = jacksonObjectMapper()
MAPPER.registerSubtypes(NamedType(Truck::class.java, "Truck"))
MAPPER.registerSubtypes(NamedType(Car::class.java, "Car"))
val vehicles = Vehicles(listOf(Car("Dodge"), Truck("Scania")))
val json = MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(vehicles)
println(json)
But the output result is the following:
"vehicles" : [
"name" : "Dodge"
,
"name" : "Scania"
]
It doesn't contain the "@type" field, so deserialization doesn't work.
Any idea how to fix it?
Jackson Kotlin version: 2.9.6
json kotlin jackson jackson2
I was trying to use the registerSubtypes function from Jackson following this tutorial.
So I've converted this code into Kotlin like so:
interface Vehicle
val name: String
class Car @JsonCreator constructor(@JsonProperty("name") override val name: String) : Vehicle
class Truck @JsonCreator constructor(@JsonProperty("name") override val name: String) : Vehicle
class Vehicles @JsonCreator constructor(@JsonProperty("vehicles") var vehicles: List<Vehicle>)
fun main()
val MAPPER = jacksonObjectMapper()
MAPPER.registerSubtypes(NamedType(Truck::class.java, "Truck"))
MAPPER.registerSubtypes(NamedType(Car::class.java, "Car"))
val vehicles = Vehicles(listOf(Car("Dodge"), Truck("Scania")))
val json = MAPPER.writerWithDefaultPrettyPrinter().writeValueAsString(vehicles)
println(json)
But the output result is the following:
"vehicles" : [
"name" : "Dodge"
,
"name" : "Scania"
]
It doesn't contain the "@type" field, so deserialization doesn't work.
Any idea how to fix it?
Jackson Kotlin version: 2.9.6
json kotlin jackson jackson2
json kotlin jackson jackson2
edited Mar 7 at 22:15
Michał Ziober
16.8k1269108
16.8k1269108
asked Mar 7 at 16:58
Benoit THBenoit TH
1475
1475
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
It is not related with Kotlin. Linked article uses Jackson in version 2.9.3. But a little bit later Another two gadgets to exploit default typing issue in jackson-databind (CVE-2018-5968) bug appeared and Jackson had to fixed that. In Jackson Release 2.9.4 this bug was fixed. Later on, new bug was created: Two morec3p0gadgets to exploit default typing issue [CVE-2018-7489] which was fixed in version 2.9.5. You are using version 2.9.6 and you noticed that behaviour changed a little bit since version 2.9.3. What does it mean for you? You need to enable default typing explicitly because it is not secure. This way:
MAPPER.enableDefaultTyping()
Check documentation to this method:
NOTE: use of Default Typing can be a potential security risk if
incoming content comes from untrusted sources, and it is recommended
that this is either not done, or, if enabled, use setDefaultTyping passing a
custom TypeResolverBuilder implementation that white-lists legal types to use.
I suggest to read Inheritance with Jackson article and use the latest version of Jackson which right now is 2.9.9. Read more about CVE in Jackson in On Jackson CVEs: Don’t Panic — Here is what you need to know article.
1
Thanks very much for your help, I found the solution I'm going to put it here in a moment. It's not related to the version at all but thank you for pointing this out I'm going to update my dependencies.
– Benoit TH
Mar 8 at 9:31
add a comment |
I've figured it out.
In case anyone has this issue in the future, in this particular example the Vehicle class would need to be annotated with @JsonTypeInfo like so :
@JsonTypeInfo(use = NAME, include = PROPERTY)
interface Vehicle
This annotation does the same whatJsonSubTypesbut with different attributes. We can provide some extra configuration using enableDefaultTyping or enableDefaultTyping(with params)
– Michał Ziober
Mar 8 at 16:22
JsonSubTypes annotation in documentation says: "Note that just annotating a property or base type with this annotation does NOT enable polymorphic type handling: in addition, JsonTypeInfo or equivalent (such as enabling of so-called "default typing") annotation is needed, and only in such case is subtype information used." Whereso-called "default typing"is ourenableDefaultTypingmethod onObjectMapper. So we have two ways to enable types: by method and annotation.
– Michał Ziober
Mar 8 at 16:25
My point was if onlyregisterSubtypesis used it doesn't work, I also needed to add the annotation
– Benoit TH
Mar 9 at 20:49
BasicallyJsonTypeInforegisters the class for polymorphism so it is required when usingregisterSubtypeand that's what my problem was
– Benoit TH
Mar 9 at 20:55
1
So I tried using Java and I have the same issue,@JsonTypeInfoneeds to be there no matter what. No idea why we're having different behaviours. At least it works for me now :) Thanks for your help anyway
– Benoit TH
Mar 10 at 13:54
|
show 1 more comment
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55049171%2fjackson-registersubtypes-not-working-in-kotlin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
It is not related with Kotlin. Linked article uses Jackson in version 2.9.3. But a little bit later Another two gadgets to exploit default typing issue in jackson-databind (CVE-2018-5968) bug appeared and Jackson had to fixed that. In Jackson Release 2.9.4 this bug was fixed. Later on, new bug was created: Two morec3p0gadgets to exploit default typing issue [CVE-2018-7489] which was fixed in version 2.9.5. You are using version 2.9.6 and you noticed that behaviour changed a little bit since version 2.9.3. What does it mean for you? You need to enable default typing explicitly because it is not secure. This way:
MAPPER.enableDefaultTyping()
Check documentation to this method:
NOTE: use of Default Typing can be a potential security risk if
incoming content comes from untrusted sources, and it is recommended
that this is either not done, or, if enabled, use setDefaultTyping passing a
custom TypeResolverBuilder implementation that white-lists legal types to use.
I suggest to read Inheritance with Jackson article and use the latest version of Jackson which right now is 2.9.9. Read more about CVE in Jackson in On Jackson CVEs: Don’t Panic — Here is what you need to know article.
1
Thanks very much for your help, I found the solution I'm going to put it here in a moment. It's not related to the version at all but thank you for pointing this out I'm going to update my dependencies.
– Benoit TH
Mar 8 at 9:31
add a comment |
It is not related with Kotlin. Linked article uses Jackson in version 2.9.3. But a little bit later Another two gadgets to exploit default typing issue in jackson-databind (CVE-2018-5968) bug appeared and Jackson had to fixed that. In Jackson Release 2.9.4 this bug was fixed. Later on, new bug was created: Two morec3p0gadgets to exploit default typing issue [CVE-2018-7489] which was fixed in version 2.9.5. You are using version 2.9.6 and you noticed that behaviour changed a little bit since version 2.9.3. What does it mean for you? You need to enable default typing explicitly because it is not secure. This way:
MAPPER.enableDefaultTyping()
Check documentation to this method:
NOTE: use of Default Typing can be a potential security risk if
incoming content comes from untrusted sources, and it is recommended
that this is either not done, or, if enabled, use setDefaultTyping passing a
custom TypeResolverBuilder implementation that white-lists legal types to use.
I suggest to read Inheritance with Jackson article and use the latest version of Jackson which right now is 2.9.9. Read more about CVE in Jackson in On Jackson CVEs: Don’t Panic — Here is what you need to know article.
1
Thanks very much for your help, I found the solution I'm going to put it here in a moment. It's not related to the version at all but thank you for pointing this out I'm going to update my dependencies.
– Benoit TH
Mar 8 at 9:31
add a comment |
It is not related with Kotlin. Linked article uses Jackson in version 2.9.3. But a little bit later Another two gadgets to exploit default typing issue in jackson-databind (CVE-2018-5968) bug appeared and Jackson had to fixed that. In Jackson Release 2.9.4 this bug was fixed. Later on, new bug was created: Two morec3p0gadgets to exploit default typing issue [CVE-2018-7489] which was fixed in version 2.9.5. You are using version 2.9.6 and you noticed that behaviour changed a little bit since version 2.9.3. What does it mean for you? You need to enable default typing explicitly because it is not secure. This way:
MAPPER.enableDefaultTyping()
Check documentation to this method:
NOTE: use of Default Typing can be a potential security risk if
incoming content comes from untrusted sources, and it is recommended
that this is either not done, or, if enabled, use setDefaultTyping passing a
custom TypeResolverBuilder implementation that white-lists legal types to use.
I suggest to read Inheritance with Jackson article and use the latest version of Jackson which right now is 2.9.9. Read more about CVE in Jackson in On Jackson CVEs: Don’t Panic — Here is what you need to know article.
It is not related with Kotlin. Linked article uses Jackson in version 2.9.3. But a little bit later Another two gadgets to exploit default typing issue in jackson-databind (CVE-2018-5968) bug appeared and Jackson had to fixed that. In Jackson Release 2.9.4 this bug was fixed. Later on, new bug was created: Two morec3p0gadgets to exploit default typing issue [CVE-2018-7489] which was fixed in version 2.9.5. You are using version 2.9.6 and you noticed that behaviour changed a little bit since version 2.9.3. What does it mean for you? You need to enable default typing explicitly because it is not secure. This way:
MAPPER.enableDefaultTyping()
Check documentation to this method:
NOTE: use of Default Typing can be a potential security risk if
incoming content comes from untrusted sources, and it is recommended
that this is either not done, or, if enabled, use setDefaultTyping passing a
custom TypeResolverBuilder implementation that white-lists legal types to use.
I suggest to read Inheritance with Jackson article and use the latest version of Jackson which right now is 2.9.9. Read more about CVE in Jackson in On Jackson CVEs: Don’t Panic — Here is what you need to know article.
answered Mar 7 at 22:34
Michał ZioberMichał Ziober
16.8k1269108
16.8k1269108
1
Thanks very much for your help, I found the solution I'm going to put it here in a moment. It's not related to the version at all but thank you for pointing this out I'm going to update my dependencies.
– Benoit TH
Mar 8 at 9:31
add a comment |
1
Thanks very much for your help, I found the solution I'm going to put it here in a moment. It's not related to the version at all but thank you for pointing this out I'm going to update my dependencies.
– Benoit TH
Mar 8 at 9:31
1
1
Thanks very much for your help, I found the solution I'm going to put it here in a moment. It's not related to the version at all but thank you for pointing this out I'm going to update my dependencies.
– Benoit TH
Mar 8 at 9:31
Thanks very much for your help, I found the solution I'm going to put it here in a moment. It's not related to the version at all but thank you for pointing this out I'm going to update my dependencies.
– Benoit TH
Mar 8 at 9:31
add a comment |
I've figured it out.
In case anyone has this issue in the future, in this particular example the Vehicle class would need to be annotated with @JsonTypeInfo like so :
@JsonTypeInfo(use = NAME, include = PROPERTY)
interface Vehicle
This annotation does the same whatJsonSubTypesbut with different attributes. We can provide some extra configuration using enableDefaultTyping or enableDefaultTyping(with params)
– Michał Ziober
Mar 8 at 16:22
JsonSubTypes annotation in documentation says: "Note that just annotating a property or base type with this annotation does NOT enable polymorphic type handling: in addition, JsonTypeInfo or equivalent (such as enabling of so-called "default typing") annotation is needed, and only in such case is subtype information used." Whereso-called "default typing"is ourenableDefaultTypingmethod onObjectMapper. So we have two ways to enable types: by method and annotation.
– Michał Ziober
Mar 8 at 16:25
My point was if onlyregisterSubtypesis used it doesn't work, I also needed to add the annotation
– Benoit TH
Mar 9 at 20:49
BasicallyJsonTypeInforegisters the class for polymorphism so it is required when usingregisterSubtypeand that's what my problem was
– Benoit TH
Mar 9 at 20:55
1
So I tried using Java and I have the same issue,@JsonTypeInfoneeds to be there no matter what. No idea why we're having different behaviours. At least it works for me now :) Thanks for your help anyway
– Benoit TH
Mar 10 at 13:54
|
show 1 more comment
I've figured it out.
In case anyone has this issue in the future, in this particular example the Vehicle class would need to be annotated with @JsonTypeInfo like so :
@JsonTypeInfo(use = NAME, include = PROPERTY)
interface Vehicle
This annotation does the same whatJsonSubTypesbut with different attributes. We can provide some extra configuration using enableDefaultTyping or enableDefaultTyping(with params)
– Michał Ziober
Mar 8 at 16:22
JsonSubTypes annotation in documentation says: "Note that just annotating a property or base type with this annotation does NOT enable polymorphic type handling: in addition, JsonTypeInfo or equivalent (such as enabling of so-called "default typing") annotation is needed, and only in such case is subtype information used." Whereso-called "default typing"is ourenableDefaultTypingmethod onObjectMapper. So we have two ways to enable types: by method and annotation.
– Michał Ziober
Mar 8 at 16:25
My point was if onlyregisterSubtypesis used it doesn't work, I also needed to add the annotation
– Benoit TH
Mar 9 at 20:49
BasicallyJsonTypeInforegisters the class for polymorphism so it is required when usingregisterSubtypeand that's what my problem was
– Benoit TH
Mar 9 at 20:55
1
So I tried using Java and I have the same issue,@JsonTypeInfoneeds to be there no matter what. No idea why we're having different behaviours. At least it works for me now :) Thanks for your help anyway
– Benoit TH
Mar 10 at 13:54
|
show 1 more comment
I've figured it out.
In case anyone has this issue in the future, in this particular example the Vehicle class would need to be annotated with @JsonTypeInfo like so :
@JsonTypeInfo(use = NAME, include = PROPERTY)
interface Vehicle
I've figured it out.
In case anyone has this issue in the future, in this particular example the Vehicle class would need to be annotated with @JsonTypeInfo like so :
@JsonTypeInfo(use = NAME, include = PROPERTY)
interface Vehicle
answered Mar 8 at 9:34
Benoit THBenoit TH
1475
1475
This annotation does the same whatJsonSubTypesbut with different attributes. We can provide some extra configuration using enableDefaultTyping or enableDefaultTyping(with params)
– Michał Ziober
Mar 8 at 16:22
JsonSubTypes annotation in documentation says: "Note that just annotating a property or base type with this annotation does NOT enable polymorphic type handling: in addition, JsonTypeInfo or equivalent (such as enabling of so-called "default typing") annotation is needed, and only in such case is subtype information used." Whereso-called "default typing"is ourenableDefaultTypingmethod onObjectMapper. So we have two ways to enable types: by method and annotation.
– Michał Ziober
Mar 8 at 16:25
My point was if onlyregisterSubtypesis used it doesn't work, I also needed to add the annotation
– Benoit TH
Mar 9 at 20:49
BasicallyJsonTypeInforegisters the class for polymorphism so it is required when usingregisterSubtypeand that's what my problem was
– Benoit TH
Mar 9 at 20:55
1
So I tried using Java and I have the same issue,@JsonTypeInfoneeds to be there no matter what. No idea why we're having different behaviours. At least it works for me now :) Thanks for your help anyway
– Benoit TH
Mar 10 at 13:54
|
show 1 more comment
This annotation does the same whatJsonSubTypesbut with different attributes. We can provide some extra configuration using enableDefaultTyping or enableDefaultTyping(with params)
– Michał Ziober
Mar 8 at 16:22
JsonSubTypes annotation in documentation says: "Note that just annotating a property or base type with this annotation does NOT enable polymorphic type handling: in addition, JsonTypeInfo or equivalent (such as enabling of so-called "default typing") annotation is needed, and only in such case is subtype information used." Whereso-called "default typing"is ourenableDefaultTypingmethod onObjectMapper. So we have two ways to enable types: by method and annotation.
– Michał Ziober
Mar 8 at 16:25
My point was if onlyregisterSubtypesis used it doesn't work, I also needed to add the annotation
– Benoit TH
Mar 9 at 20:49
BasicallyJsonTypeInforegisters the class for polymorphism so it is required when usingregisterSubtypeand that's what my problem was
– Benoit TH
Mar 9 at 20:55
1
So I tried using Java and I have the same issue,@JsonTypeInfoneeds to be there no matter what. No idea why we're having different behaviours. At least it works for me now :) Thanks for your help anyway
– Benoit TH
Mar 10 at 13:54
This annotation does the same what
JsonSubTypes but with different attributes. We can provide some extra configuration using enableDefaultTyping or enableDefaultTyping(with params)– Michał Ziober
Mar 8 at 16:22
This annotation does the same what
JsonSubTypes but with different attributes. We can provide some extra configuration using enableDefaultTyping or enableDefaultTyping(with params)– Michał Ziober
Mar 8 at 16:22
JsonSubTypes annotation in documentation says: "Note that just annotating a property or base type with this annotation does NOT enable polymorphic type handling: in addition, JsonTypeInfo or equivalent (such as enabling of so-called "default typing") annotation is needed, and only in such case is subtype information used." Where
so-called "default typing" is our enableDefaultTyping method on ObjectMapper. So we have two ways to enable types: by method and annotation.– Michał Ziober
Mar 8 at 16:25
JsonSubTypes annotation in documentation says: "Note that just annotating a property or base type with this annotation does NOT enable polymorphic type handling: in addition, JsonTypeInfo or equivalent (such as enabling of so-called "default typing") annotation is needed, and only in such case is subtype information used." Where
so-called "default typing" is our enableDefaultTyping method on ObjectMapper. So we have two ways to enable types: by method and annotation.– Michał Ziober
Mar 8 at 16:25
My point was if only
registerSubtypes is used it doesn't work, I also needed to add the annotation– Benoit TH
Mar 9 at 20:49
My point was if only
registerSubtypes is used it doesn't work, I also needed to add the annotation– Benoit TH
Mar 9 at 20:49
Basically
JsonTypeInfo registers the class for polymorphism so it is required when using registerSubtype and that's what my problem was– Benoit TH
Mar 9 at 20:55
Basically
JsonTypeInfo registers the class for polymorphism so it is required when using registerSubtype and that's what my problem was– Benoit TH
Mar 9 at 20:55
1
1
So I tried using Java and I have the same issue,
@JsonTypeInfo needs to be there no matter what. No idea why we're having different behaviours. At least it works for me now :) Thanks for your help anyway– Benoit TH
Mar 10 at 13:54
So I tried using Java and I have the same issue,
@JsonTypeInfo needs to be there no matter what. No idea why we're having different behaviours. At least it works for me now :) Thanks for your help anyway– Benoit TH
Mar 10 at 13:54
|
show 1 more comment
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55049171%2fjackson-registersubtypes-not-working-in-kotlin%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown