Re: [jackson-user] Re: Deserialization error. no String-argument constructor/factory method to deserialize from String

2018-12-09 Thread Tatu Saloranta
On Tue, Oct 30, 2018 at 10:32 PM Yuriy Barvenko wrote: > > > I just forgot to write, that i use a Lombok framework wit @Data for generate > get and set methods > > среда, 31 октября 2018 г., 3:26:00 UTC+1 пользователь Yuriy Barvenko написал: >> >> I am trying to deserialize following JSON >> >>

Re: [jackson-user] Inheritance and circular references

2018-12-09 Thread Tatu Saloranta
Simplest answer I can give is that you should avoid ever using generic type values as root value (immediate object you give to writeValue() / readValue()). Generic types are fine everywhere else reachable through POJO properties, but at root level Java Type Erasure causes problems. In this case

Re: [jackson-user] Deserialize JSON string to Map

2018-12-04 Thread Tatu Saloranta
On Tue, Dec 4, 2018 at 10:45 AM Pankaj Dighe wrote: > I am trying to deserialize following JSON to map of > > String jsonString = "{\"personId\": 231, \"percentage\": 2.1212, \"name\": > \"Name\", " + > "\"activeDate\":\"26-09-2017 11:00:00\"}"; > > > I am trying to deserialize using

Re: [jackson-user] Gzip JsonFactory/ObjectMapper?

2018-11-23 Thread Tatu Saloranta
On Fri, Nov 23, 2018 at 8:17 PM wrote: > > Hi, > > I have been scratching my head for the last hour or two looking for a Gzip > JsonFactory or any other type of factory that is able to compress huge Json > objects, > I know I'm going to sacrifice some performance but for this particular >

Re: [jackson-user] Gzip JsonFactory/ObjectMapper?

2018-11-27 Thread Tatu Saloranta
On Sat, Nov 24, 2018 at 2:17 PM wrote: > Now I'm curious of smile combined with this LZ4 implementation > https://github.com/lz4/lz4-java > The time is pretty close and the compression is decent, what do you think > I need to do to be able to decorate the *SmileFactory*? > In theory, should

Re: [jackson-user] Gzip JsonFactory/ObjectMapper?

2018-11-27 Thread Tatu Saloranta
On Sat, Nov 24, 2018 at 12:10 PM wrote: > Quite strangely, the JDK's GZip is winning vs these fancy compression > algorithms: > > Json size: 2727kb > Json time: 26.426ms > > Smile size: 1043kb > Smile time: 20.366ms > > Compressed Smile size: 914kb > Compressed Smile time: 20.678ms > > GZip

Re: [jackson-user] @JsonView not propagated to (“nested”) custom serializer

2018-11-27 Thread Tatu Saloranta
If the call is exactly as shown and version of Jackson relatively new, this might be a bug. View information should be retained. But it is possible this could be due to certain code constructs such as calling `writeObject()` on `JsonGenerator`, which will result in new `SerializerProvider`

Re: [jackson-user] Re: How to append single json strings to an existing file?

2019-01-04 Thread Tatu Saloranta
I think at this point I would need actual unit test. Reading code seemed ok, but without actual exception message it's hard to know what might be wrong. -+ Tatu +- On Fri, Jan 4, 2019 at 4:01 AM MV wrote: > Hi Tatu > > I made a few changes to my POJO to avoid the circular reference issue. Now

Re: [jackson-user] @JsonUnwrapped not working as expected with @JsonProperty

2018-09-11 Thread Tatu Saloranta
On Tue, Sep 11, 2018 at 12:56 AM Slawek Mazur wrote: > > > > W dniu poniedziałek, 10 września 2018 23:36:43 UTC+2 użytkownik Tatu > Saloranta napisał: >> >> On Mon, Sep 10, 2018 at 8:13 AM Slawek Mazur wrote: >> > >> > Here's the scenario: >

[jackson-user] Jackson 2.9.7 patch release out

2018-09-18 Thread Tatu Saloranta
As per https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.9.7 Jackson 2.9.7 is now out. Possibly most important are CVE fixes bundled under: https://github.com/FasterXML/jackson-databind/issues/2097 but there are many other fixes, especially to `jackson-databind` so that upgrade is

Re: [jackson-user] Re: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.ObjectMapper in Java 11

2018-12-09 Thread Tatu Saloranta
On Sun, Dec 9, 2018 at 1:04 AM Dvir L wrote: > Found an issue with the class loader on Java 11. Solved and everything > works fine with Jackson 2.8.5. > Thank you guys ! > Great you got that resolved! -+ Tatu +- > -- > You received this message because you are subscribed to the Google Groups

Re: [jackson-user] Deserializing 3rd party Lombok builder class

2019-01-24 Thread Tatu Saloranta
On Thu, Jan 24, 2019 at 8:39 PM pscl wrote: > > Hi, > > Here's a question I've posted on SO - crossposting here in hope of getting > some domain-expertise. > > > I have a 3rd party Lombok builder POJO, one that I cannot modify, that I want > to serialize using jackson. Notably it does not have

Re: [jackson-user] Polymorphic Custom Serialization

2019-03-25 Thread Tatu Saloranta
On Mon, Mar 25, 2019 at 5:18 PM Suraj Mathai wrote: > > Hi, > > I have Parent Class and Subclasses . Can I customize the serialization of > fields of parent class using ParentClassSerializer and fields of subclass > using SubClassSerializer. how do i do this ? > > Thanks in advance for your

Re: [jackson-user] Jackson 2.10 / 3.x Release Dates

2019-03-29 Thread Tatu Saloranta
On Fri, Mar 29, 2019 at 3:08 PM Jack Higgins wrote: > > Hi, > > Apologies if this is already documented online. No it actually isn't. I am not quite sure what would be a good way, given that estimation for anything other than patches is strictly on "when it feels it might be time" basis.

Re: [jackson-user] Processing JSON Ref ($ref)

2019-03-26 Thread Tatu Saloranta
On Tue, Mar 26, 2019 at 8:36 PM wrote: > Hi, > > I'm trying to convert: > > { > "real": [ > 1, > 2, > 3, > 4 > ], > "ref": { > "$ref": "#/real" > } > } > > > to > > { > 'real': [ > 1, > 2, > 3, > 4 > ], > 'ref': [ > 1, > 2, > 3, >

Re: [jackson-user] Polymorphic Custom Serialization

2019-03-26 Thread Tatu Saloranta
the reverse would be possible with `@JsonUnwrapped`, but there is no matching `@JsonWrapped`. -+ Tatu +- > Thanks again > > On Tuesday, March 26, 2019 at 1:35:03 PM UTC+11, Tatu Saloranta wrote: >> >> On Mon, Mar 25, 2019 at 5:18 PM Suraj Mathai >> wrote:

Re: [jackson-user] github noob: Trying to "checkout" 2.9.8.

2019-03-23 Thread Tatu Saloranta
On Fri, Mar 22, 2019 at 9:47 AM Artificial Life wrote: > > Ok, I'm apparently hopeless in this regard. I came from the ancient days of > sccs/rcs/pvcs and then later cvs, and ignored this git business until now and > it has me completely mystified. > > I'm trying to download a copy of 2.9.8

Re: [jackson-user] github noob: Trying to "checkout" 2.9.8.

2019-03-23 Thread Tatu Saloranta
On Sat, Mar 23, 2019 at 4:12 PM Artificial Life wrote: > > On Saturday, March 23, 2019 at 6:41:50 PM UTC-4, Tatu Saloranta wrote: >> >> On Fri, Mar 22, 2019 at 9:47 AM Artificial Life wrote: >> > >> > Ok, I'm apparently hopeless in this regard. I came fro

Re: [jackson-user] Configure CsvMapper to Inspect Each Value Written

2019-02-25 Thread Tatu Saloranta
There is no such callback. What is usually done, I think, is to first serialize content as a tree (JsonNode), traverse that, make necessary modifications, and then serialize tree value. -+ Tatu +- On Tue, Feb 19, 2019 at 1:47 PM wrote: > I am using jackson-dataformat-csv to export a POJO

Re: [jackson-user] @JsonIdentityReference(alwaysAsId = true), but only some times!

2019-03-01 Thread Tatu Saloranta
On Tue, Feb 19, 2019 at 12:03 PM Lalit Patil wrote: > > > > On Monday, February 18, 2019 at 4:35:41 PM UTC-5, Tatu Saloranta wrote: >> >> >> >> On Mon, Feb 18, 2019 at 1:27 PM Lalit Patil wrote: >>> >>> I need to serialize a Java object

Re: [jackson-user] Re: How to represent JSON to allow efficient manipulations

2019-03-01 Thread Tatu Saloranta
On Wed, Feb 27, 2019 at 4:58 AM wrote: > > Thanks for the reply Burak. > > You are indeed right that JsonNode employs standard Java Map, List objects. > Though note that each JsonNode includes specialized serialize(JsonGenerator, > SerializerProvider) methods which I think way better than

Re: [jackson-user] NoSuchMethodError: com.fasterxml.jackson.core.JsonStreamContext Ask Question

2019-03-01 Thread Tatu Saloranta
On Fri, Mar 1, 2019 at 9:07 PM Raj wrote: > > I'm trying to bump the jackson version number from 2.8.6 to 2.9.8 and it is > just not working the way it is supposed to work. > > It's giving this error: > > java.lang.NoSuchMethodError: > com.fasterxml.jackson.core.JsonStreamContext.(II)V > >

Re: [jackson-user] Deserialize YAML with anchors and references

2019-02-21 Thread Tatu Saloranta
where backwards-incompatible (regarding internal interfaces, not so much public API) are needed. Concept of Native Object Ids was added for YAML, but it was retrofit same way as whole Object Id handling was (over original system that had no concept or support), and warts are the result. -+ T

Re: [jackson-user] Jackson in AWS Lambdas and cold start time

2019-02-22 Thread Tatu Saloranta
y adopters, to give trial runs for new features when I add them (jackson-jr test pilots!). -+ Tatu +- On Fri, Jan 12, 2018 at 4:00 PM Tatu Saloranta wrote: > > You can try to disable `MapperFeature.USE_ANNOTATIONS`, and that may help. > But there are other non-trivial costs, esp. for Reflec

Re: [jackson-user] Cannot deserialize instance of `java.util.ArrayList` out of VALUE_STRING token - jenkinsfile

2019-03-12 Thread Tatu Saloranta
On Tue, Mar 12, 2019 at 8:38 PM joseph labonte wrote: > > Hello! > > In my jenkinsfile I am writing to a yaml file. > > One of the parameters being taken is is written to the yaml file like this: > > param: test-targets=[annotation > com.company.android.customAnnotations.SanityTest,

Re: [jackson-user] Serialisation of maps as beans

2019-03-18 Thread Tatu Saloranta
On Mon, Mar 18, 2019 at 7:28 PM Jan Bernitt wrote: > > Hi, > > given this model: > > interface A extends Map { > > Map getExtensions(); > > String getX(); > > void setX(String x); > } > > class Foo extends A { } > class Bar { } > > Filling it with data: > > Foo foo = new Foo(); >

Re: [jackson-user] Including type info on Double NaN and Infinity

2019-02-07 Thread Tatu Saloranta
{ >> doubleSerializer.serialize(aDouble, jsonGenerator, >> serializerProvider); >> } >> }; >> } >> >> @Override >> public void serialize(Double aDouble, JsonGenerator jsonGenerator, >> Serializ

Re: [jackson-user] does jackson caches property serialization info

2019-02-12 Thread Tatu Saloranta
On Tue, Feb 12, 2019 at 10:05 AM Hursant B wrote: > > public class ConfigurationEntity{ > JSONObject config; > } > > example contents of config > > { > "collection":["www.google.com"] > } > > { > "collection":[{ > "url":"www.google.com" > }] > } > > serializing

Re: [jackson-user] How to handle empty Array XML to JSON

2019-02-14 Thread Tatu Saloranta
d most programming languages do. -+ Tatu +- > On Tue, Feb 5, 2019, 03:53 Tatu Saloranta > >> On Fri, Feb 1, 2019 at 4:57 PM Fhakruddin Mohamed >> wrote: >> > >> > { >> > test: [] >> > } >> > >> > This result is not achievable.

Re: [jackson-user] Deserialize YAML with anchors and references

2019-02-14 Thread Tatu Saloranta
On Tue, Feb 12, 2019 at 8:43 PM John Passaro wrote: > > On Tue, Feb 12, 2019, 23:02 Tatu Saloranta > >> On Tue, Feb 12, 2019 at 1:18 PM John Passaro >> wrote: >> > >> > Hello folks! I am trying to deserialize a yaml file with anchors and >> > r

Re: [jackson-user] Including type info on Double NaN and Infinity

2019-02-10 Thread Tatu Saloranta
The issue itself: https://github.com/FasterXML/jackson-databind/issues/2236 has now been fixed for upcoming 2.10.0 -+ Tatu +- On Thu, Feb 7, 2019 at 8:10 PM Tatu Saloranta wrote: > Ok. As to the original question: reading and writing floating-point > values is pretty slow, in general

Re: [jackson-user] Deserialize YAML with anchors and references

2019-02-14 Thread Tatu Saloranta
On Wed, Feb 13, 2019 at 9:10 AM John Passaro wrote: > > On Tuesday, February 12, 2019 at 11:43:38 PM UTC-5, John Passaro wrote: >> >> On Tue, Feb 12, 2019, 23:02 Tatu Saloranta wrote: >>> >>> On Tue, Feb 12, 2019 at 1:18 PM John Passaro wrote: >>> &g

Re: [jackson-user] StdDeserializer for Enum

2019-02-05 Thread Tatu Saloranta
On Tue, Feb 5, 2019 at 2:40 PM wrote: > > Hello, > > how can I get StdDeserializer for Enum (in general)? For numbers and String > I found as NumberDeserializer.ShortDeserializer etc. and new > StringDeserializer(). > Purpose of using is described e.g in topic >

Re: [jackson-user] Throws when an array of array is parsed

2019-02-01 Thread Tatu Saloranta
On Fri, Feb 1, 2019 at 4:57 PM Ashwin Asp wrote: > > Hello I am trying to parse the below array that contains array of objects. > > public class JsonParser { > public JsonParser() { > > String jsonString = >

Re: [jackson-user] Is the CVE-2018-19362 fixed in jackson-databind version 2.9.8 ?

2019-01-30 Thread Tatu Saloranta
On Wed, Jan 30, 2019 at 3:19 PM Penny Wells wrote: > > We use jackson-databind 2.9.7 but cannot upgrade to 2.9.8 due to the > CVE-2018-19362. > I do see a bugfix applied into github for 2.9.8 but can't be sure as the CVE > does not have this information. > Can someon confirm for us that this

Re: [jackson-user] Deserializing 3rd party Lombok builder class

2019-01-30 Thread Tatu Saloranta
); >} >return new JsonPOJOBuilder.Value("build", ""); >} >}); >} > } Excellent! Thank you for sharing this. -+ Tatu +- > > > > On Thursday, January 24, 2019 at 8:45:02 PM UTC-8, Tat

Re: [jackson-user] Polymorphic deserialization with @JsonTypeInfo annotations but also considering valueType?

2019-01-30 Thread Tatu Saloranta
On Mon, Jan 28, 2019 at 3:36 PM Jeff Evans wrote: > > Suppose I have the following class hierarchy and Jackson annotations. > > @JsonTypeInfo(use=JsonTypeInfo.Id.CLASS > public class Base { > private int value; > // snipped getter and setter for "value" field > } > > public class Foo extends

Re: [jackson-user] JSON message processors for Apache HttpClient 5.0

2019-02-04 Thread Tatu Saloranta
On Mon, Feb 4, 2019 at 2:21 PM wrote: > > Folks, > > I put together a small library for Apache HttpClient 5.0 that makes use of > Jackson's asynchronous JsonParser to reactively handle incoming HTTP messages > with enclosed content consisting of a single JSON object or a long sequence > of

Re: [jackson-user] How to handle empty Array XML to JSON

2019-02-04 Thread Tatu Saloranta
On Fri, Feb 1, 2019 at 4:57 PM Fhakruddin Mohamed wrote: > > { > test: [] > } > > This result is not achievable. > > Please advice. Unfortunately I do not quite understand what your problem is here. What are you trying to do? With what kind of code? -+ Tatu +- -- You received this message

Re: [jackson-user] @JsonIdentityInfo only abbreviate one element per list

2019-04-09 Thread Tatu Saloranta
On Fri, Apr 5, 2019 at 11:38 AM wrote: > > Hi! > > So, im tryin to use @JsonIdentityInfo to avoid ciclical relationships because > i'm trying to serialize an hibernate entity with a one-to-many relationship. > > My functions needs to return a List of the child class element, and the >

[jackson-user] Re: @JsonTypeInfo query

2019-04-09 Thread Tatu Saloranta
On Tuesday, April 9, 2019 at 12:25:19 PM UTC-7, Paulomi Mukherjee wrote: > > Hi All, > > > If we add @JsonTypeInfo annotation to the parent class, is it mandatory > that the payload of both the parent class and child class should have > " (like @class for ID set as CLASS)" to explicitly specify

Re: [jackson-user] PropertySerializerMap$Empty static initialization throwing fatal NoSuchMethodError

2019-04-09 Thread Tatu Saloranta
On Tue, Apr 9, 2019 at 12:25 PM Aishwarya Agarwal wrote: > > Fatal Exception: java.lang.NoSuchMethodError: No direct method ()B in class B > or its super classes (declaration of 'byte' appears in generated class) >at >

Re: [jackson-user] How to parse this JSON

2019-04-15 Thread Tatu Saloranta
On Mon, Apr 15, 2019 at 4:18 PM Udhayabalachandar Chandarsekran wrote: > > Hi, > I have a json file in below format, how could parse this JSON file using ur > json parser. > > the Header values are reside in the json file, how can I separate value and > the json messages. Please help me to

Re: [jackson-user] Unable to download dependency org.codehaus.jackson:jackson-core-asl for version [1.9.13]

2019-04-15 Thread Tatu Saloranta
On Mon, Apr 15, 2019 at 4:18 PM Davide Pallaoro wrote: > > Hi there, > > I wite you because I am having some issue with maven and jackson-core-asl > dependency, and I hope you can help me. > > > Since this morning (15/4/2019) we are having problems in our CI because of > the following error : >

Re: [jackson-user] de/serialization of nested maps

2019-04-16 Thread Tatu Saloranta
On Tue, Apr 16, 2019 at 1:05 PM Chris C wrote: > I have a map of type > > Map> > > that I want to serialize to json to store in as a field in a database > record. > > Key1 and Key2 are my own classes with getters defined and the constructors > annotated as JsonCreators. > > I have been able to

Re: [jackson-user] Unable to control precision while serializing BigDecimal or Double

2019-04-17 Thread Tatu Saloranta
On Tue, Apr 16, 2019 at 9:18 PM Navish Sharma wrote: > > While serializing an object containing Double or BigDecimal values, is there > a option to control the precision while serializing? I understand that the > setters within the object can be a good option to control the rounding off >

Re: [jackson-user] jsonFactory.createParser eagerly reads from the InputStream to detect the encoding

2019-04-17 Thread Tatu Saloranta
On Wed, Apr 17, 2019 at 6:34 PM Artashes Aghajanyan wrote: > > I noticed the following behavior that feels like a bug to me, but I want to > confirm if it's not by design before opening an issue in github. > > jackson-databind-2.4.3 > > Consider the following code fragment: > > ByteBuf in = ...

Re: [jackson-user] de/serialization of nested maps

2019-04-17 Thread Tatu Saloranta
On Wed, Apr 17, 2019 at 9:02 AM Chris C wrote: > > On Tuesday, April 16, 2019 at 5:05:14 PM UTC-4, Tatu Saloranta wrote: >> >> On Tue, Apr 16, 2019 at 1:05 PM Chris C wrote: >>> >>> I have a map of type >>> >>> Map> >>> >>

[jackson-user] Jackson 2.9.9 patch release available

2019-05-16 Thread Tatu Saloranta
So, Jackson 2.9.9 is now out (with jackson-module-scala 2.9.9 to be released soon), with following fixes: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.9.9 Of more than 20 fixes, one is for a security vulnerability (just one more gadget type for polymorphic deser), so upgrade is

Re: [jackson-user] Truncate long texts using JsonGenerator

2019-05-27 Thread Tatu Saloranta
On Mon, May 27, 2019 at 12:35 PM Volkan Yazıcı wrote: > > Hello, > > log4j2-logstash-layout uses Jackson JsonGenerator to emit JSON. There is a > ticket on the project asking for truncating strings longer than a certain > value. The most straightforward (and crude?) approach, I guess, would be

Re: [jackson-user] My custom Deserializer provide parent of the type.

2019-06-01 Thread Tatu Saloranta
On Sat, Jun 1, 2019 at 8:26 AM 遗迹 wrote: > > Ah, it not makes difference. I upgrade to 2.9.9 version, but the problem > still exists. Maybe I should create a issue :) I think that makes sense, yes. -+ Tatu +- > > Thank you. > > 在 2019年6月1日星期六 UTC+8上午7:41:25,Tatu Saloranta

Re: [jackson-user] Can I ask Jackson for a fully refined deserializable type?

2019-06-12 Thread Tatu Saloranta
On Sat, Jun 8, 2019 at 5:42 AM Bojan Tomic wrote: > > Let's say I have a generic interface Inter, configured via > @JsonDeserialize(as = Impl.class) to always deserialize as Impl. > Can I somehow ask Jackson to fully refine the a type into its deserializable > version, so that for e.g. Inter>

Re: [jackson-user] Issue Parsing Custom(?) Date

2019-05-11 Thread Tatu Saloranta
On Sat, May 11, 2019 at 10:23 AM Richi Plana wrote: > > I used swagger-codegen to generate the stubs using the Feign library and > internally it uses Jackson. I'm having an issue parsing a date; getting the > following error: > >> Exception in thread "main" feign.FeignException: Cannot

Re: [jackson-user] Issue Parsing Custom(?) Date

2019-05-14 Thread Tatu Saloranta
vious format. If an > OffsetDateTime is an invalid type for a timestamp without a timezone, I can > change that much. The service is set in stone. I think this would probably be more of a LocalDateTime, then, which is logical time without timezone. -+ Tatu +- > > On Saturday, 11 May 2019 14:47:18 UTC

Re: [jackson-user] JSON Response Has Escaped Quotations Using Jackson and JAX-RS Exception Mapper

2019-05-21 Thread Tatu Saloranta
not have specific structure. The other side has no idea what kind of in-memory representation server uses: it's just json. -+ Tatu +- > > > On Tuesday, May 21, 2019 at 7:08:22 PM UTC-4, Tatu Saloranta wrote: >> >> On Tue, May 21, 2019 at 3:57 PM Uzh Valin wrote: >&g

Re: [jackson-user] JSON Response Has Escaped Quotations Using Jackson and JAX-RS Exception Mapper

2019-05-22 Thread Tatu Saloranta
gt; I am not sure I understand -- `JsonNode` is simply node-based >> representation of JSON, which serializes to textual content like >> POJOs. There is nothing special about it, it's just one way to >> manipulate JSON content that may or may not have specific structure. >> The ot

Re: [jackson-user] Duplicate Properties with Fields with all the name with upperCase

2019-05-10 Thread Tatu Saloranta
On Thu, May 9, 2019 at 4:16 PM Manuel Garcia wrote: > > HI All, > > We have a problem with UPPERCASE fields, like in this closed issued in Jackson > > https://github.com/FasterXML/jackson-databind/issues/1609 > > But I prefer to know your opinion due to I think that it is really an issue. > > We

Re: [jackson-user] Why jackson renames my object properties?

2019-05-21 Thread Tatu Saloranta
That does not look like Java. Is it Kotlin? If so, I think there are a few issues filed: https://github.com/FasterXML/jackson-module-kotlin/issues that talk about this problem. Fundamentally I think this stems from the fact that Java Bean convention considers boolean isSomeProperty() to

Re: [jackson-user] JSON Response Has Escaped Quotations Using Jackson and JAX-RS Exception Mapper

2019-05-21 Thread Tatu Saloranta
Just one question: > responseBody.put("firstProperty", > serializeFirstProperty(obj.getFirstProperty())); > responseBody.put("secondProperty", > serializeSecondProperty(obj.getSecondProperty())); > responseBody.put("thirdProperty", >

Re: [jackson-user] Re: NPE with JsonIdentityReference and serializer modifier

2019-05-21 Thread Tatu Saloranta
On Tue, May 21, 2019 at 11:20 AM undefined wrote: > Hello from the future ! > > I've ran into this issue but I don't understand what you guys meant by > "Delegating to the default serializer" ? > That would refer to your custom serializer keeping a reference to the "default serializer", one

Re: [jackson-user] com.fasterxml.jackson.core:jackson-databind + JDK11

2019-05-21 Thread Tatu Saloranta
On Tue, May 21, 2019 at 3:48 PM Алексей Рединский wrote: > > Hello guys, > > we are in the process of migrating from JDK8 to JDK11 and our internal tool > says that the library is not JDK11 compatible because it uses some of the > removed API's and/or classes. Are there any plans to make it

Re: [jackson-user] Re: Jackson 2.9.9 patch release available

2019-05-21 Thread Tatu Saloranta
evious 2.9.x versions, and does include minimal support in form of Automatic-Module-Name. 2.10.0 will add full module definitions (but will not require use of JDK 9 or later -- JDK 6 runtime is enough, JDK 8 to build). -+ Tatu +- > > On Thursday, May 16, 2019 at 3:51:23 PM UTC-7, Tatu Saloran

Re: [jackson-user] @JsonIgnore not working in Mix-in when field has @JsonFormat

2019-05-21 Thread Tatu Saloranta
ar to `@JsonProperty`, i.e. to indicate inclusion. I am not sure if the behavior can easily be changed as there is legit use case where this difference is needed, for example to prevent "wrong" setter or getter from being used. But you can make your use case work, I think, by changing mix-

Re: [jackson-user] Why jackson renames my object properties?

2019-05-21 Thread Tatu Saloranta
On Tue, May 21, 2019 at 3:48 PM Tamás Cservenák wrote: > > If kotlin, and hence vert-x kotlin integration, I don't think > jackson-module-kotlin is involved at all... Interesting -- I would not recommend use of Kotlin values without the module but if it works (minus this issue) I guess that's

Re: [jackson-user] JSON Response Has Escaped Quotations Using Jackson and JAX-RS Exception Mapper

2019-05-21 Thread Tatu Saloranta
n Tuesday, May 21, 2019 at 2:40:27 PM UTC-4, Tatu Saloranta wrote: >> >> Just one question: >> >> >>> >>> responseBody.put("firstProperty", >>> serializeFirstProperty(obj.getFirstProperty())); >>> responseBody.pu

Re: [jackson-user] What shall I start with if I want to add some other markup language parser into jackson?

2019-05-16 Thread Tatu Saloranta
On Thu, May 16, 2019 at 8:28 AM Xeno Amess wrote: > > as title. > I'm now learning about https://github.com/FasterXML/jackson-dataformat-xml > and hoping I can figure out how to achieve it. > If anybody have some guides about such thing, I'd be appreciated. The main idea behind support for

Re: [jackson-user] @JsonIgnore not working in Mix-in when field has @JsonFormat

2019-05-16 Thread Tatu Saloranta
On Thu, May 16, 2019 at 8:28 AM cofe wrote: > > same as subject. > Jackson version: 2.9.8 > > Entity > @Getter > @Setter > public class GeneralUser { > private String name; > private String password; > @JsonFormat(pattern = "-MM-dd HH:mm:SS") > private Date createTime; >

Re: [jackson-user] Conditionally flattening an attribute

2019-04-26 Thread Tatu Saloranta
On Fri, Apr 26, 2019 at 8:46 PM Eric Fenderbosch wrote: > > Is it possible, using Views or otherwise, to conditionally flatten an > attribute? > > For example, View #1: > { > "attr1": "somevalue", > "attr2": { > "id": 123, > "foo": "bar" > } > } > > and View #2: > { > "attr1":

Re: [jackson-user] jsonFactory.createParser eagerly reads from the InputStream to detect the encoding

2019-04-18 Thread Tatu Saloranta
don't want it to read and parse everything from the > stream? > I think that is true, although I am not sure memcpy of a partial buffer is significant enough to worry about. But yes in general it is more efficient not to do something at all in the first place. -+ Tatu +- > > On W

Re: [jackson-user] de/serialization of nested maps

2019-04-19 Thread Tatu Saloranta
On Fri, Apr 19, 2019 at 9:39 AM Chris C wrote: > > > On Wednesday, April 17, 2019 at 8:59:03 PM UTC-4, Tatu Saloranta wrote: >> >> On Wed, Apr 17, 2019 at 9:02 AM Chris C wrote: >> > >> > On Tuesday, April 16, 2019 at 5:05:14 PM UTC-4, Tatu Saloranta wrote

Re: [jackson-user] Upgrading from Jackson-databind-2.6.6 to 2.9.8

2019-05-02 Thread Tatu Saloranta
On Thu, May 2, 2019 at 8:11 PM Matt Sun wrote: > > Hi Jackson-users! > > We are looking to upgrading an old library that uses databind-2.6.6 to 2.9.8 > due to security vulnerability issues. Due to the nature of this old library, > we are trying to avoid making code changes if possible. Can

Re: [jackson-user] Customized handling of unknown properties.

2019-05-08 Thread Tatu Saloranta
On Tue, May 7, 2019 at 4:41 PM wrote: > > Hi, > > I believe I have quite specific question. Is there a path in which I could > customize the Jackson deserializer in a way that for every unknown property > it would populates object internal map with it's value? > > Example: Simple Java POJO: > >

Re: [jackson-user] Jackson-Databind 2.10 / 3.x Vulnerabilities (CVE's) Fix

2019-05-08 Thread Tatu Saloranta
On Wed, May 8, 2019 at 2:13 AM Jack Higgins wrote: > > Hi @cowtowncoder, > > Apologies if I'm repeating an old question here. > > I have a service which is using jackson-databind and I'm aware that in > version 2.9.8 the issue regarding CVE vulnerabilities related to > jackson-databind and

[jackson-user] `jackson-databind` 2.9.9.1 micro-patch released for 2 CVEs

2019-07-03 Thread Tatu Saloranta
As per title, `2.9.9.1` of `jackson-databind` was released (ahead of full `2.9.10` that will take longer), and contains fixes to 2 CVEs (of polymorphic deser variety, see https://medium.com/@cowtowncoder/on-jackson-cves-dont-panic-here-is-what-you-need-to-know-54cd0d6e8062). This is to be used

Re: [jackson-user] XmlMapper. Cannot deserialize instance of `java.util.ArrayList` out of VALUE_STRING token

2019-07-11 Thread Tatu Saloranta
On Wed, Jul 10, 2019 at 4:55 PM Dmitriy Grigoryev wrote: > Hi! > I have the following formatted xml fragment of some service response: > > ... > > > ... > > > *Note! *There is *linebreak* between start and closing elements. > > And I have the following corresponding code fragment: > >

Re: [jackson-user] Deserialize a JSON with keeping a value as String

2019-07-11 Thread Tatu Saloranta
On Sat, Jul 6, 2019 at 1:20 AM 'Johannes Paul' via jackson-user < jackson-user@googlegroups.com> wrote: > I would like to deserialize a JSON to an Object, which holds a Object > named 'data'. I want everything to be stored as a string, to deserialize it > later. > The reason is, i dont know the

Re: [jackson-user] @JsonAnyGetter with a map which can contain keys for which a specific getter exists

2019-07-14 Thread Tatu Saloranta
On Wed, Jul 10, 2019 at 4:55 PM Raffaele Gambelli wrote: > > Hi all, > > I'm experiencing some jon fields duplication problems using @JsonAnyGetter > annotation. > > If I have a class with a name attribute and its getter and a map annotated > with @JsonAnyGetter containing an entry having

Re: [jackson-user] @JsonSerialize ignoring properties with annotation?

2019-07-14 Thread Tatu Saloranta
On Sun, Jul 7, 2019 at 2:14 AM 'Howard Rees' via jackson-user < jackson-user@googlegroups.com> wrote: > Hi, > I have a requirement to uppercase certain values during serialisation, so > I've created a custom serialiser that accepts an argument within the > constructor as I only want this code

Re: [jackson-user] Jackson 2.9.8 and Jva 8 support - Can we keep using Java 7 with Jackson 2.9.8 (Build and Runtime)

2019-07-01 Thread Tatu Saloranta
but I think would allow use of newer Jackson versions on Java 6. -+ Tatu +- > > > 1.7 > 1.7 > > > The last one with java 6 target is 2.7.9.5, but this one still carries 9 > known CVEs... > > Is there any workaround known/suggested? > > Thanks and greetings!!! >

Re: [jackson-user] How do deserialize polymorophic object using WRAPPER_OBJECT with multiple keys

2019-04-22 Thread Tatu Saloranta
On Mon, Apr 22, 2019 at 10:28 AM doug.tarr via jackson-user wrote: > > I have an object that looks like so: > > { > >"add" : { ...} > } > > { > > "subtract" : { ...} > } > > > Add and Subtract are both subclasses of an abstract Operator class and are > set up as JsonSubTypes > >

Re: [jackson-user] Jackson 2.9.8 and Jva 8 support - Can we keep using Java 7 with Jackson 2.9.8 (Build and Runtime)

2019-07-01 Thread Tatu Saloranta
On Mon, Jul 1, 2019 at 8:06 AM Michael Rogers wrote: > > On 01/07/2019 15:57, Tatu Saloranta wrote: > > If anyone is aware of retro-weaver style tools that can take jars with > > newer declared bytecode version and convert to older, that'd be great, > > sharing most ap

Re: [jackson-user] Query on JsonTypeInfo.defaultImpl

2019-07-01 Thread Tatu Saloranta
On Wed, Jun 19, 2019 at 10:07 AM Paulomi Mukherjee wrote: > > Parent.java has > > @JsonTypeInfo( > > use = JsonTypeInfo.Id.NAME, > > defaultImpl = com.common.model.Parent.class, > > include = JsonTypeInfo.As.EXISTING_PROPERTY, > > property = "@class" > > ) > >

Re: [jackson-user] jackson defaultImpl incase of subtype extending another subtype of parent class not working

2019-07-01 Thread Tatu Saloranta
On Mon, Jul 1, 2019 at 7:44 AM Avinash Vundyala wrote: > > My class Subtype structure looks like: > >A > / \ > B C > / \ >D E > > and using Jackson to deserialize JSON and when I mention defaultImpl to class > A then I get: > > Class A not subtype of

[jackson-user] New contributors welcome -- tagged issues at https://github.com/FasterXML/jackson-modules-java8/issues

2019-08-13 Thread Tatu Saloranta
So: since it looks like: (a) there are many issues filed against Java 8 date/time module (lots of interest) (b) I am struggling to keep up with issues everywhere (c) Many of java 8 date/time issues might be relatively easy to solve (but obviously still need focus) I went ahead and added labels

Re: [jackson-user] Jackson-Databind 2.10 / 3.x Vulnerabilities (CVE's) Fix

2019-07-29 Thread Tatu Saloranta
ll under "default settings" seems like the best way to go; and that would mark 2.10 as solution to this particular stream of issues. WDYT? -+ Tatu +- > > On Wednesday, May 8, 2019 at 8:59:16 PM UTC+2, Tatu Saloranta wrote: >> >> On Wed, May 8, 2019 at 2:13 AM Jack Hig

Re: [jackson-user] Re: Jackson 2.10 pre-release, 2.10.0.pr1, available

2019-08-12 Thread Tatu Saloranta
On Mon, Aug 12, 2019 at 8:41 PM Ari Maniatis wrote: > > I came to find this mailing list just to understand what pr means. So for me, > a vote for using common industry accepted terms: I was under impression that "pr" for "pre-release" would actually we quite widely known. I guess I learned

Re: [jackson-user] Avoiding @type for serialization depending on the field declaration on the parent

2019-08-12 Thread Tatu Saloranta
On Mon, Aug 12, 2019 at 5:56 PM Pablo Pazos wrote: > > Hi, > > I have a model where some class attributes are concrete/final and other are > generic, I want to avoid adding the @type to the concrete/final. Here is an > example: > > class Action { > >DvTime time; > } > > class Element { > >

Re: [jackson-user] Rejecting CVEs for jackson-databind

2019-08-10 Thread Tatu Saloranta
On Sat, Aug 10, 2019 at 7:32 PM Daniel Beck wrote: > > Hi, > > To the best of my knowledge, the feature affected by the many recent CVEs in > jackson-databind is opt-in: It requires an #enableDefaultTyping() call, or an > @JsonTypeInfo on a field with a wide open type. Hi Daniel! I have been

[jackson-user] Restrict wiki modify access to main Jackson repo

2019-08-10 Thread Tatu Saloranta
Quick announcement: I changed write-access to Wiki pages on: https://github.com/FasterXML/jackson to only let collaborators make changes. This may be cumbersome wrt contributing changes to Wiki pages -- which is unfortunate -- but given that this repo is the entry point and public face of the

[jackson-user] Welcome the newest core contributor for Jackson Scala module: PJ Fanning

2019-08-27 Thread Tatu Saloranta
Quick introduction to everyone: after a few useful contributions, PJ (@pjfanning) is now the newest addition to the Scala module core team, joining existing core developers (Morten, Nate, Christopher). He can review, approve and merge Pull Requests. We will also probably need to figure out what

[jackson-user] Jackson 2.10.0.pr2 being released (Scala with some delay)

2019-08-30 Thread Tatu Saloranta
So, as per title, 2.10.0.pr2 has now been (mostly) released: as usual, Scala module will be released with some delay. Fixes are listed on: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.10 although not separated by pr1 / pr2 (individual issues should have that information) --

[jackson-user] Minor additions to Scala module README, strong encourage PRs for that, others

2019-08-28 Thread Tatu Saloranta
So: with addition of PJ as a new core developer for Scala module, I realized that it'd make sense to include at least basic list of core developers on README: https://github.com/FasterXML/jackson-module-scala since while info is of course available with Team/collaborators page under Settings,

[jackson-user] New (co-)maintainers for Jackson Kotlin module Wanted!

2019-08-23 Thread Tatu Saloranta
TL;DNR; We need more developers who can ok PRs, commit them. Longer: Due to increasing popularity of Kotlin (yay!), Jackson Kotlin module has gotten ever increasing usage, interest, and as a result many new edge cases have been uncovered, and new feature requests filed. This is great! What is

Re: [jackson-user] Android linter error: Invalid package references from com.fasterxml.jackson.module.jaxb

2019-08-23 Thread Tatu Saloranta
On Tue, Aug 13, 2019 at 11:07 PM anu thomas wrote: > > I'm writing an android application, which has following Jackson dependencies: > > implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.9' > > implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.9' > > >

Re: [jackson-user] Questions about JsonDeserialize.keyUsing,

2019-08-23 Thread Tatu Saloranta
On Tue, Aug 20, 2019 at 1:03 PM Erik Ramfelt wrote: > > Hi > > If I check the documentation for the keyUsing annotation, it states that it > is for methods, fields and constructors. [1] But the documentation at github > states that it is for (method, field). [2] Perhaps confusion here is

Re: [jackson-user] Avoiding @type for serialization depending on the field declaration on the parent

2019-08-23 Thread Tatu Saloranta
On Mon, Aug 12, 2019 at 10:54 PM Pablo Pazos wrote: > > Hi Tatu, > > On Tuesday, August 13, 2019 at 12:46:33 AM UTC-3, Tatu Saloranta wrote: >> >> On Mon, Aug 12, 2019 at 5:56 PM Pablo Pazos wrote: >> > >> > Hi, >> > >> > I have a mo

Re: [jackson-user] Ability to deserialize dictionary (HashMap) on top level

2019-08-23 Thread Tatu Saloranta
On Wed, Aug 21, 2019 at 10:02 AM EnterpriseJacksonBeansFrameworkCE wrote: > > > I am trying to map json dictionary of objects with known structure to POJO > under jackson control: > > import com.fasterxml.jackson.annotation.JsonProperty; > > > public class GetListOfRecordsResponse { > >

Re: [jackson-user] Polymorphic serialisation of Map values doesn't work?

2019-09-12 Thread Tatu Saloranta
On Thu, Sep 12, 2019 at 11:27 AM Marc Dzaebel wrote: > > Hi, > > I defined a mapper that serializes Exception's polymorphically, but the > following simple map serializes without @class attribute in its values: > > Map map = new HashMap<>(); > map.put(1, new Exception("test")); >

Re: [jackson-user] Polymorphic serialisation of Map values doesn't work?

2019-09-16 Thread Tatu Saloranta
On Mon, Sep 16, 2019 at 1:27 AM Marc Dzaebel wrote: > Thanks Tatu, > > good to know about both alternatives. I'll use you recommendation, the > wrapper. I also found it on SO here > , >

Re: [jackson-user] Rejecting CVEs for jackson-databind

2019-09-14 Thread Tatu Saloranta
On Sat, Sep 14, 2019 at 6:58 AM Daniel Beck wrote: > > > > On 11. Aug 2019, at 04:45, Tatu Saloranta wrote: > > > > Thoughts? > > Thanks for your response. These plans sound great! > > > - Question: should replacement methods use different namin

<    1   2   3   4   5   6   7   8   >