Re: [jackson-user] Serialize Generic Collection Issues

2017-02-13 Thread Yosvany Llerena Rodríguez
Thank @Tatu. Sorry abut the delay. I will be back as soon as I test moving 
from 2.8.0 to 2.8.6.
BR

On Wednesday, January 25, 2017 at 6:40:09 PM UTC, Tatu Saloranta wrote:
>
> Ok, assuming this is with a reasonably up-to-date version (2.8.6 or 
> 2.7.8), at this point it would make sense to file a bug report, with simple 
> reproduction at:
>
> https://github.com/FasterXML/jackson-databind/issues
>
>  `type` property should be serialized given information you have given, as 
> far as I can see.
>
> -+ Tatu +-
>
> On Wed, Jan 25, 2017 at 1:17 AM, Yosvany Llerena Rodríguez <
> yosva...@gmail.com > wrote:
>
>> HI
>> I do change as you recommend but results are the same. Nothing changes, 
>> the property continues not appearing.
>> @JsonTypeInfo(use = JsonTypeInfo.Id.NAME , 
>> include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true)
>> @JsonSubTypes({
>> @JsonSubTypes.Type(value = DarkObjectInstance.class, name = 
>> "dark"),
>> @JsonSubTypes.Type(value = UnknownObjectInstance.class, name = 
>> "unknown")})
>> public abstract class ObjectInstance implements Serializable {
>> private static final long serialVersionUID = -8515880933242237477L;
>>  private List fields;
>> }
>>
>>
>> Br
>>
>> On Friday, January 20, 2017 at 11:57:44 PM UTC, Tatu Saloranta wrote:
>>>
>>> One problem I see is the use of `As.EXTERNAL_PROPERTY`: this is not 
>>> what you want based on expected json structure. 
>>> Instead you probably just want to use plain `As.PROPERTY` (unless you 
>>> want to also map it to a regular, existing property, in which case 
>>> `As.EXISTING_PROPERTY` may be more appropriate). 
>>>
>>> -+ Tatu +- 
>>>
>>>
>>> On Wed, Jan 18, 2017 at 9:57 AM, Yosvany Llerena Rodríguez 
>>>  wrote: 
>>> > Hi 
>>> > I have some issues with polymorphic collecction serialization and I'm 
>>> not 
>>> > able to find the problem. 
>>> > 
>>> > I have this "type" external property defined, but I'm not able to see 
>>> it on 
>>> > my response output 
>>> > 
>>> > Example a DarkObjectInstance serializes like 
>>> > {"fields":[], "connections": "AB+/-E} and should be {"type":"dark", 
>>> > "fields":[], "connections": "AB+/-E} 
>>> > 
>>> > UnknownObjectInstance will be: 
>>> > {"fields":[], "primitives": [{"deck":"S"}]} and should be 
>>> {"type":"unknown", 
>>> > "fields":[], "primitives": [{"deck":"S"}]} 
>>> > 
>>> > 
>>> > @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = 
>>> > JsonTypeInfo.As.EXTERNAL_PROPERTY, property = "type", visible = true) 
>>> > @JsonSubTypes({ 
>>> > @JsonSubTypes.Type(value = DarkObjectInstance.class, name = 
>>> "dark"), 
>>> > @JsonSubTypes.Type(value = UnknownObjectInstance.class, name = 
>>> > "unknown")}) 
>>> > public abstract class ObjectInstance implements Serializable { 
>>> > private static final long serialVersionUID = 
>>> -8515880933242237477L; 
>>> >  private List fields; 
>>> > } 
>>> > 
>>> > public class DarkObjectInstance extends ObjectInstanceDto { 
>>> >private String connections; 
>>> > ... 
>>> > } 
>>> > 
>>> > public class UnknownObjectInstance extends ObjectInstanceDto { 
>>> >private List primitves; 
>>> > ... 
>>> > } 
>>> > 
>>> > Any help will be apreciated 
>>> > 
>>> > BR 
>>> > 
>>> > -- 
>>> > 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 jackson-user...@googlegroups.com. 
>>> > To post to this group, send email to jackso...@googlegroups.com. 
>>> > 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 jackson-user...@googlegroups.com .
>> To post to this group, send email to jackso...@googlegroups.com 
>> .
>> 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 jackson-user+unsubscr...@googlegroups.com.
To post to this group, send email to jackson-user@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jackson-user] Serialize Generic Collection Issues

2017-01-25 Thread Tatu Saloranta
Ok, assuming this is with a reasonably up-to-date version (2.8.6 or 2.7.8),
at this point it would make sense to file a bug report, with simple
reproduction at:

https://github.com/FasterXML/jackson-databind/issues

 `type` property should be serialized given information you have given, as
far as I can see.

-+ Tatu +-

On Wed, Jan 25, 2017 at 1:17 AM, Yosvany Llerena Rodríguez <
yosvany...@gmail.com> wrote:

> HI
> I do change as you recommend but results are the same. Nothing changes,
> the property continues not appearing.
> @JsonTypeInfo(use = JsonTypeInfo.Id.NAME ,
> include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true)
> @JsonSubTypes({
> @JsonSubTypes.Type(value = DarkObjectInstance.class, name =
> "dark"),
> @JsonSubTypes.Type(value = UnknownObjectInstance.class, name =
> "unknown")})
> public abstract class ObjectInstance implements Serializable {
> private static final long serialVersionUID = -8515880933242237477L;
>  private List fields;
> }
>
>
> Br
>
> On Friday, January 20, 2017 at 11:57:44 PM UTC, Tatu Saloranta wrote:
>>
>> One problem I see is the use of `As.EXTERNAL_PROPERTY`: this is not
>> what you want based on expected json structure.
>> Instead you probably just want to use plain `As.PROPERTY` (unless you
>> want to also map it to a regular, existing property, in which case
>> `As.EXISTING_PROPERTY` may be more appropriate).
>>
>> -+ Tatu +-
>>
>>
>> On Wed, Jan 18, 2017 at 9:57 AM, Yosvany Llerena Rodríguez
>>  wrote:
>> > Hi
>> > I have some issues with polymorphic collecction serialization and I'm
>> not
>> > able to find the problem.
>> >
>> > I have this "type" external property defined, but I'm not able to see
>> it on
>> > my response output
>> >
>> > Example a DarkObjectInstance serializes like
>> > {"fields":[], "connections": "AB+/-E} and should be {"type":"dark",
>> > "fields":[], "connections": "AB+/-E}
>> >
>> > UnknownObjectInstance will be:
>> > {"fields":[], "primitives": [{"deck":"S"}]} and should be
>> {"type":"unknown",
>> > "fields":[], "primitives": [{"deck":"S"}]}
>> >
>> >
>> > @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include =
>> > JsonTypeInfo.As.EXTERNAL_PROPERTY, property = "type", visible = true)
>> > @JsonSubTypes({
>> > @JsonSubTypes.Type(value = DarkObjectInstance.class, name =
>> "dark"),
>> > @JsonSubTypes.Type(value = UnknownObjectInstance.class, name =
>> > "unknown")})
>> > public abstract class ObjectInstance implements Serializable {
>> > private static final long serialVersionUID = -8515880933242237477L;
>> >  private List fields;
>> > }
>> >
>> > public class DarkObjectInstance extends ObjectInstanceDto {
>> >private String connections;
>> > ...
>> > }
>> >
>> > public class UnknownObjectInstance extends ObjectInstanceDto {
>> >private List primitves;
>> > ...
>> > }
>> >
>> > Any help will be apreciated
>> >
>> > BR
>> >
>> > --
>> > 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 jackson-user...@googlegroups.com.
>> > To post to this group, send email to jackso...@googlegroups.com.
>> > 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 jackson-user+unsubscr...@googlegroups.com.
> To post to this group, send email to jackson-user@googlegroups.com.
> 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 jackson-user+unsubscr...@googlegroups.com.
To post to this group, send email to jackson-user@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [jackson-user] Serialize Generic Collection Issues

2017-01-20 Thread Tatu Saloranta
One problem I see is the use of `As.EXTERNAL_PROPERTY`: this is not
what you want based on expected json structure.
Instead you probably just want to use plain `As.PROPERTY` (unless you
want to also map it to a regular, existing property, in which case
`As.EXISTING_PROPERTY` may be more appropriate).

-+ Tatu +-


On Wed, Jan 18, 2017 at 9:57 AM, Yosvany Llerena Rodríguez
 wrote:
> Hi
> I have some issues with polymorphic collecction serialization and I'm not
> able to find the problem.
>
> I have this "type" external property defined, but I'm not able to see it on
> my response output
>
> Example a DarkObjectInstance serializes like
> {"fields":[], "connections": "AB+/-E} and should be {"type":"dark",
> "fields":[], "connections": "AB+/-E}
>
> UnknownObjectInstance will be:
> {"fields":[], "primitives": [{"deck":"S"}]} and should be {"type":"unknown",
> "fields":[], "primitives": [{"deck":"S"}]}
>
>
> @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include =
> JsonTypeInfo.As.EXTERNAL_PROPERTY, property = "type", visible = true)
> @JsonSubTypes({
> @JsonSubTypes.Type(value = DarkObjectInstance.class, name = "dark"),
> @JsonSubTypes.Type(value = UnknownObjectInstance.class, name =
> "unknown")})
> public abstract class ObjectInstance implements Serializable {
> private static final long serialVersionUID = -8515880933242237477L;
>  private List fields;
> }
>
> public class DarkObjectInstance extends ObjectInstanceDto {
>private String connections;
> ...
> }
>
> public class UnknownObjectInstance extends ObjectInstanceDto {
>private List primitves;
> ...
> }
>
> Any help will be apreciated
>
> BR
>
> --
> 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 jackson-user+unsubscr...@googlegroups.com.
> To post to this group, send email to jackson-user@googlegroups.com.
> 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 jackson-user+unsubscr...@googlegroups.com.
To post to this group, send email to jackson-user@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.