Re: [jackson-user] Re: JsonGenerationException with custom serializers for nested object

2018-12-20 Thread Tatu Saloranta
On Thu, Dec 20, 2018 at 1:51 PM matt Smith wrote: > > I am serializing `i` which would be "abc" : ["item1", "item2", item3"]. > `i` is object here and I have defined in same serializer how to serialize > "this" object > > do you want the example checked into github for quick run? But this "ab

Re: [jackson-user] Re: JsonGenerationException with custom serializers for nested object

2018-12-20 Thread matt Smith
is that clear Tatu? On Thursday, December 20, 2018 at 1:51:04 PM UTC-8, matt Smith wrote: > > I am serializing `i` which would be "abc" : ["item1", "item2", item3"]. > `i` is object here and I have defined in same serializer how to serialize > "this" object > > do you want the example checked int

Re: [jackson-user] Re: JsonGenerationException with custom serializers for nested object

2018-12-20 Thread matt Smith
I am serializing `i` which would be "abc" : ["item1", "item2", item3"]. `i` is object here and I have defined in same serializer how to serialize "this" object do you want the example checked into github for quick run? On Thursday, December 20, 2018 at 1:44:45 PM UTC-8, Tatu Saloranta wrote: >

Re: [jackson-user] Re: JsonGenerationException with custom serializers for nested object

2018-12-20 Thread Tatu Saloranta
On Thu, Dec 20, 2018 at 1:28 PM matt Smith wrote: > > I added as comments beside each line in the else block below. that is what I > expect it to work. is my expectation in any of those lines? Almost right, with one incorrect one: > > if (items.isEmpty()) { > jgen.writeStartObj

Re: [jackson-user] How to transform Jackson exceptions to user-friendly error messages?

2018-12-20 Thread Tatu Saloranta
On Fri, Dec 14, 2018 at 4:06 AM Burak Emre Kabakcı wrote: > > We use Jackson for parsing JSON data in our RESTFul API, our models also > automatically validate the data so we mark properties as required, use enums > wherever possible etc. For example; if a required property is not set, > Jackso

Re: [jackson-user] Re: Recursive serializers and deserializers using jackson is not working as expected

2018-12-20 Thread Tatu Saloranta
I think you should not recursively call `serialize()` with `getArgs()`, if you do not want values wrapped as JSON Objects. You probably need to refactor code a bit, so that outermost cases outputs full Object, args case just appends name/value pairs. Also one simplification I suggest is that inste

[jackson-user] Re: JsonGenerationException with custom serializers for nested object

2018-12-20 Thread matt Smith
I added as comments beside each line in the else block below. that is what I expect it to work. is my expectation in any of those lines? if (items.isEmpty()) { jgen.writeStartObject(); jgen.writeFieldName(id); jgen.writeStartArray();

Re: [jackson-user] class level JsonSerializable vs Method level

2018-12-20 Thread Tatu Saloranta
On Thu, Dec 20, 2018 at 11:22 AM matt Smith wrote: > > I encountered a case where class level JsonSerializable annotation does not > require registration with Simple Module but method level does. Hmmh. This seems odd, let's see. > Here is the example I tried > > @JsonSerialize(using = ItemRowS

Re: [jackson-user] jackson-databind-2.6.7.2

2018-12-20 Thread Tatu Saloranta
On Thu, Dec 20, 2018 at 9:08 AM garvit singh wrote: > > github security alert shows these CVEs for jackson-databind 2.7.9.4 That would also contain fixes yes. Github issues I listed should contain accurate information of inclusion. -+ Tatu +- > > On Tuesday, December 11, 2018 at 10:10:15 PM UTC

Re: [jackson-user] JsonGenerationException with custom serializers for nested object

2018-12-20 Thread Tatu Saloranta
I think the problem is here: On Thu, Dec 20, 2018 at 11:32 AM matt Smith wrote: > > here is the class that I want to serialize. > > > public class ItemRow { > > private String id; > private List items; > } > > >There are two variations that are allowed. > > `ItemRow, Ite

[jackson-user] JsonGenerationException with custom serializers for nested object

2018-12-20 Thread matt Smith
here is the class that I want to serialize. public class ItemRow { private String id; private List items; } There are two variations that are allowed. `ItemRow, ItemRow`. In the latter case, it will be nested. eg: ItemRow item1 = new ItemRow("a

[jackson-user] class level JsonSerializable vs Method level

2018-12-20 Thread matt Smith
I encountered a case where class level JsonSerializable annotation does not require registration with Simple Module but method level does . Here is the example I trie

Re: [jackson-user] jackson-databind-2.6.7.2

2018-12-20 Thread garvit singh
github security alert shows these CVEs for jackson-databind 2.7.9.4 On Tuesday, December 11, 2018 at 10:10:15 PM UTC-5, Tatu Saloranta wrote: > > On Tue, Dec 11, 2018 at 7:04 PM garvit singh > wrote: > > > > Hello, > > > > jackson-databind-2.6.7.2 > > > > > > does it have fix for > > > >