[jira] [Updated] (JOHNZON-402) Polymorphism attributes not serialized if @JsonbTypeInfo is not attached to direct parent

2024-07-16 Thread Chris Wells (Jira)


 [ 
https://issues.apache.org/jira/browse/JOHNZON-402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Wells updated JOHNZON-402:

Reporter: Markus Jung  (was: Markus Jung)

> Polymorphism attributes not serialized if @JsonbTypeInfo is not attached to 
> direct parent
> -
>
> Key: JOHNZON-402
> URL: https://issues.apache.org/jira/browse/JOHNZON-402
> Project: Johnzon
>  Issue Type: New Feature
>  Components: JSON-B
>Affects Versions: 2.0.0
>Reporter: Markus Jung
>Assignee: Markus Jung
>Priority: Minor
> Fix For: 2.0.1
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> After thinking through the polymorphism code again for JONZON-401 I noticed 
> an issue where polymorphism properties aren't taken into account if the 
> @JsonbTypeInfo annotation is not attached to a direct parent of the 
> serialized class.
> Take this example test:
> {code:java}
> public class JsonbMultiLevelPolymorphismTest {
> @Rule
> public JsonbRule jsonb = new JsonbRule();
> @Test
> public void test() {
> ConcreteSomething info = new ConcreteSomething();
> assertEquals("{\"@type\":\"concrete\"}", jsonb.toJson(info));
> }
> @JsonbTypeInfo(
> @JsonbSubtype(alias = "concrete", type = ConcreteSomething.class)
> )
> public static abstract class AbstractTopLevelSomething { }
> public static abstract class AbstractMiddleLevelSomething extends 
> AbstractTopLevelSomething { }
> public static class ConcreteSomething extends 
> AbstractMiddleLevelSomething { }
> } {code}
> Test result:
> {code:java}
> org.junit.ComparisonFailure: 
> Expected :{"@type":"concrete"}
> Actual   :{} {code}
>  
> The spec doesn't mention that @JsonbTypeInfo has to be attached to a direct 
> parent. This also works perfectly fine in yasson, so I see no reason why it 
> should not in johnzon.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (JOHNZON-402) Polymorphism attributes not serialized if @JsonbTypeInfo is not attached to direct parent

2024-04-01 Thread Romain Manni-Bucau (Jira)


 [ 
https://issues.apache.org/jira/browse/JOHNZON-402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Romain Manni-Bucau updated JOHNZON-402:
---
Fix Version/s: 2.0.1
   (was: 2.1.0)

> Polymorphism attributes not serialized if @JsonbTypeInfo is not attached to 
> direct parent
> -
>
> Key: JOHNZON-402
> URL: https://issues.apache.org/jira/browse/JOHNZON-402
> Project: Johnzon
>  Issue Type: New Feature
>  Components: JSON-B
>Affects Versions: 2.0.0
>Reporter: Markus Jung
>Assignee: Markus Jung
>Priority: Minor
> Fix For: 2.0.1
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> After thinking through the polymorphism code again for JONZON-401 I noticed 
> an issue where polymorphism properties aren't taken into account if the 
> @JsonbTypeInfo annotation is not attached to a direct parent of the 
> serialized class.
> Take this example test:
> {code:java}
> public class JsonbMultiLevelPolymorphismTest {
> @Rule
> public JsonbRule jsonb = new JsonbRule();
> @Test
> public void test() {
> ConcreteSomething info = new ConcreteSomething();
> assertEquals("{\"@type\":\"concrete\"}", jsonb.toJson(info));
> }
> @JsonbTypeInfo(
> @JsonbSubtype(alias = "concrete", type = ConcreteSomething.class)
> )
> public static abstract class AbstractTopLevelSomething { }
> public static abstract class AbstractMiddleLevelSomething extends 
> AbstractTopLevelSomething { }
> public static class ConcreteSomething extends 
> AbstractMiddleLevelSomething { }
> } {code}
> Test result:
> {code:java}
> org.junit.ComparisonFailure: 
> Expected :{"@type":"concrete"}
> Actual   :{} {code}
>  
> The spec doesn't mention that @JsonbTypeInfo has to be attached to a direct 
> parent. This also works perfectly fine in yasson, so I see no reason why it 
> should not in johnzon.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (JOHNZON-402) Polymorphism attributes not serialized if @JsonbTypeInfo is not attached to direct parent

2024-01-28 Thread Romain Manni-Bucau (Jira)


 [ 
https://issues.apache.org/jira/browse/JOHNZON-402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Romain Manni-Bucau updated JOHNZON-402:
---
Issue Type: New Feature  (was: Bug)

> Polymorphism attributes not serialized if @JsonbTypeInfo is not attached to 
> direct parent
> -
>
> Key: JOHNZON-402
> URL: https://issues.apache.org/jira/browse/JOHNZON-402
> Project: Johnzon
>  Issue Type: New Feature
>  Components: JSON-B
>Affects Versions: 2.0.0
>Reporter: Markus Jung
>Priority: Major
>
> After thinking through the polymorphism code again for JONZON-401 I noticed 
> an issue where polymorphism properties aren't taken into account if the 
> @JsonbTypeInfo annotation is not attached to a direct parent of the 
> serialized class.
> Take this example test:
> {code:java}
> public class JsonbMultiLevelPolymorphismTest {
> @Rule
> public JsonbRule jsonb = new JsonbRule();
> @Test
> public void test() {
> ConcreteSomething info = new ConcreteSomething();
> assertEquals("{\"@type\":\"concrete\"}", jsonb.toJson(info));
> }
> @JsonbTypeInfo(
> @JsonbSubtype(alias = "concrete", type = ConcreteSomething.class)
> )
> public static abstract class AbstractTopLevelSomething { }
> public static abstract class AbstractMiddleLevelSomething extends 
> AbstractTopLevelSomething { }
> public static class ConcreteSomething extends 
> AbstractMiddleLevelSomething { }
> } {code}
> Test result:
> {code:java}
> org.junit.ComparisonFailure: 
> Expected :{"@type":"concrete"}
> Actual   :{} {code}
>  
> The spec doesn't mention that @JsonbTypeInfo has to be attached to a direct 
> parent. This also works perfectly fine in yasson, so I see no reason why it 
> should not in johnzon.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (JOHNZON-402) Polymorphism attributes not serialized if @JsonbTypeInfo is not attached to direct parent

2024-01-28 Thread Romain Manni-Bucau (Jira)


 [ 
https://issues.apache.org/jira/browse/JOHNZON-402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Romain Manni-Bucau updated JOHNZON-402:
---
Priority: Minor  (was: Major)

> Polymorphism attributes not serialized if @JsonbTypeInfo is not attached to 
> direct parent
> -
>
> Key: JOHNZON-402
> URL: https://issues.apache.org/jira/browse/JOHNZON-402
> Project: Johnzon
>  Issue Type: New Feature
>  Components: JSON-B
>Affects Versions: 2.0.0
>Reporter: Markus Jung
>Priority: Minor
>
> After thinking through the polymorphism code again for JONZON-401 I noticed 
> an issue where polymorphism properties aren't taken into account if the 
> @JsonbTypeInfo annotation is not attached to a direct parent of the 
> serialized class.
> Take this example test:
> {code:java}
> public class JsonbMultiLevelPolymorphismTest {
> @Rule
> public JsonbRule jsonb = new JsonbRule();
> @Test
> public void test() {
> ConcreteSomething info = new ConcreteSomething();
> assertEquals("{\"@type\":\"concrete\"}", jsonb.toJson(info));
> }
> @JsonbTypeInfo(
> @JsonbSubtype(alias = "concrete", type = ConcreteSomething.class)
> )
> public static abstract class AbstractTopLevelSomething { }
> public static abstract class AbstractMiddleLevelSomething extends 
> AbstractTopLevelSomething { }
> public static class ConcreteSomething extends 
> AbstractMiddleLevelSomething { }
> } {code}
> Test result:
> {code:java}
> org.junit.ComparisonFailure: 
> Expected :{"@type":"concrete"}
> Actual   :{} {code}
>  
> The spec doesn't mention that @JsonbTypeInfo has to be attached to a direct 
> parent. This also works perfectly fine in yasson, so I see no reason why it 
> should not in johnzon.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)