Re: [jackson-user] Custom deserializer recursively calls `deserialize` method

2019-05-22 Thread Tatu Saloranta
On Wed, May 22, 2019 at 12:40 PM 'ilker cam' via jackson-user wrote: > > Hi, > > I have a property which can be an integer or an object without any explicit > `type` property. I tried to use JsonDeserialize annotation and provide a > custom deserializer; > > data class Report(val measures: List)

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

2019-05-22 Thread Tatu Saloranta
;> 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. >&

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

2019-05-22 Thread Tatu Saloranta
; How can I pass my default serializer to this class ? You kept on asking question "I don't understand what you mean by delegating", so I answered that. At this point I have wasted enough time to understand the question. I hope someone else has time to spend on this and help, -+

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 t

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

2019-05-31 Thread Tatu Saloranta
On Fri, May 31, 2019 at 3:29 PM 遗迹 wrote: > Hello, > > I create a deserializer for match corret subclass of abstract class. > > I register the deserializer for `InputMessageContent`. > But when I call `jp.getCodec().readTree(jp)` in > `deserializer(JsonParser jp, DeserializationContext ctxt)`. >

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> I

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
ire some local work from user's part, 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/sug

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 mo

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" > > ) > > @Json

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 [simple

[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 wit

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: > > @Jacks

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 ex

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 "name"

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 exec

Re: [jackson-user] Serializing Object does not serialize last element in Set.

2019-07-17 Thread Tatu Saloranta
On Tue, Jul 16, 2019 at 6:17 PM Kiren Pillay wrote: > > Hi > > I'm having an issue where the last element in my Object's list is not getting > serialized. Debugging shows that the required values for Categories are > present. > > Submitting a number of times, the order of this list can change, a

Re: [jackson-user] JsonSubTypes doesn't work with mixin

2019-07-17 Thread Tatu Saloranta
On Sat, Jul 6, 2019 at 1:20 AM Konstantin Klimov wrote: > > Dear jackson community, > > I'm trying to use @JsonTypeInfo and @JsonSubTypes I in a mixin to create > polymorphic type mapping for third-party classes. But it looks like the > annotations do not work with mixin. Could anybody please d

Re: [jackson-user] LocalDate being converted to LinkedHashMap

2019-07-17 Thread Tatu Saloranta
On Sat, Jul 6, 2019 at 1:20 AM gurpal2000 wrote: > > I have a pojo that includes a LocalDate (with a year, month, day populated > only) > > I then attempt to convert the member variables and object values to a > Map using this: > > Map map = objectMapper.convertValue(obj, new > TypeReference>()

Re: [jackson-user] Dynamic deserialization without any parent/class interface based on a common field

2019-07-17 Thread Tatu Saloranta
On Mon, Jul 1, 2019 at 7:44 AM Matthieu Ghilain wrote: > > Is it possible for jackson to deserialize an unknown payload based on some > type mapping information provided via a field which is present in all the > payloads? > > Constraint: the payload should not have any parent class/interface. >

Re: [jackson-user] deserialization help - array

2019-07-17 Thread Tatu Saloranta
On Tue, Jul 16, 2019 at 6:17 PM Nicola Delbono wrote: > > > Hello, > I can't figure out how to deserialize the following structure. > > > "years":{ > "2019":{ /* contains "week" objects */ }, > "2020":{ /* contains "week" objects */ }, > "2021":{ /* con

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

2019-07-20 Thread Tatu Saloranta
After multiple delays, we finally have the first pre-release/release-candidate of Jackson 2.10 -- version 2.10.0.pr1. It is released in hopes of getting more testing by community, so that we can minimize number of regressions, as well as better documented observed differences (beyond what is includ

Re: [jackson-user] What's the correct way to instantiate ParameterNamesModule for constructor deserialization?

2019-07-22 Thread Tatu Saloranta
On Mon, Jul 22, 2019 at 8:04 AM Jean Dannemann wrote: > Whats the correct way to instantiate ParameterNamesModule for "constructor > with all fields" deserialization? > > > It already works for me.. but it works in both ways!.. whats the > difference of > > > new ParameterNamesModule() > > and >

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

2019-07-22 Thread Tatu Saloranta
nal pointers, suggestions, feedback? At very least it would be good to figure out improved naming for 3.0.x releases, if nothing else. (with 2.10.x there is also the question of continuing with `prX` since there is already one out, so problem already exists) -+ Tatu +- > > Kind regards >

Re: [jackson-user] @JsonCreator with builder and external type I’d not supported? Why?

2019-07-22 Thread Tatu Saloranta
On Mon, Jul 22, 2019 at 12:26 PM Randy Tidd wrote: > > I have this case on my current project, we are using the builder pattern and > have an embedded generic object that requires an external type id. Based on > this code this appears to not be supported and based on true comment this has > bee

Re: [jackson-user] @JsonCreator with builder and external type I’d not supported? Why?

2019-07-24 Thread Tatu Saloranta
etheless with a reproduction I should be able to help. From description behavior sounds wrong, but in a way that sounds potentially easy to fix (vs. something that sounds more along "that's unfortunately the way it works because XYZ"). -+ Tatu +- > > Randy > > On Monday, July 22

Re: [jackson-user] Serialization to subtype when type info parameter is missing

2019-07-25 Thread Tatu Saloranta
On Tue, Jul 23, 2019 at 5:19 PM Saurabh Pawar wrote: > > I have polymorphic types and serialization when the type parameter is passed > in JSON works fine. > > > import com.fasterxml.jackson.annotation.JsonIgnoreProperties; > import com.fasterxml.jackson.annotation.JsonSubTypes; > import com.fast

[jackson-user] On submitting security (vulnerability) disclosures

2019-07-25 Thread Tatu Saloranta
Due to steady stream of Default Typing related reports on more known "gadget types" (see https://medium.com/@cowtowncoder/on-jackson-cves-dont-panic-here-is-what-you-need-to-know-54cd0d6e8062 for background), I think it makes sense to clarify the procedure I think works best. First of all, a good

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

2019-07-29 Thread Tatu Saloranta
ing does not fall 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

Re: [jackson-user] Unresolved forward references when trying to deserialize JSON into java objects

2019-07-30 Thread Tatu Saloranta
On Fri, Jul 26, 2019 at 1:46 PM Marcin Kwapisz wrote: > > A few days ago I stuck with the problem in the topic. I found a solution and > described it on Stackoverflow. > > Here I would like to ask why I cannot use @JsonCreator annotated methods or > constructors and why a parameterless construct

Re: [jackson-user] Multiple Jackson XML Custom (XMLStreamWriter) Serialisers throws Exception

2019-07-31 Thread Tatu Saloranta
On Wed, Jul 31, 2019 at 4:42 PM Rajesh KSV wrote: > > > If there are multiple custom XML Serializers (XMLStreamWriter) in a class, > serialization fails > > I have two classes. CustomClass1, CustomClass2. There is a wrapping class > TestJacksonXml1. When I am trying to serialize TestJacksonXml1,

Re: [jackson-user] Change field name serialization without @JsonProperty

2019-08-06 Thread Tatu Saloranta
On Mon, Aug 5, 2019 at 4:22 PM Mark Derricutt wrote: > > Hey all, > > I have an internal SimpleModule which provides a custom serialiser for some > types we use which works great when they're used as values, but not so much > when they're keys in a map. > > We're serialising out some internal Cl

Re: [jackson-user] Change field name serialization without @JsonProperty

2019-08-06 Thread Tatu Saloranta
On Tue, Aug 6, 2019 at 4:03 PM Mark Derricutt wrote: > > On 7 Aug 2019, at 7:52, Tatu Saloranta wrote: > > In > your case, then, I think it's just matter of registering key > serializers along with value serializers. > > That works a treat! Cheers - saves me recu

Re: [jackson-user] JSON serialization questions

2019-08-06 Thread Tatu Saloranta
On Tue, Aug 6, 2019 at 3:08 PM Pablo Pazos wrote: > > Hi all, I'm new to Jackson, and I was assigned to a project that uses it. > > Our project A uses an external project B, where the model I need to serialize > is defined. Most of the articles I read about Jackson rely heavily on adding > annot

Re: [jackson-user] Add or ignore attribute on JSON serialization depending on it's value

2019-08-07 Thread Tatu Saloranta
On Wed, Aug 7, 2019 at 9:38 AM Pablo Pazos wrote: > > Hi, I have a complex model, where some attributes are collections and if the > collection is empty I need to ignore adding if to the serialized JSON object, > because right now I see items: [] everywhere (many of my classes have that > attri

Re: [jackson-user] Add or ignore attribute on JSON serialization depending on it's value

2019-08-07 Thread Tatu Saloranta
if you want wide defaults. -+ Tatu +- > > On Wednesday, August 7, 2019 at 2:27:35 PM UTC-3, Tatu Saloranta wrote: >> >> On Wed, Aug 7, 2019 at 9:38 AM Pablo Pazos wrote: >> > >> > Hi, I have a complex model, where some attributes are collections and if >> &

Re: [jackson-user] JSON serialization questions

2019-08-09 Thread Tatu Saloranta
On Tue, Aug 6, 2019 at 4:50 PM Pablo Pazos wrote: > > Hey Tatu, that is really great feedback thanks! > > see below > > On Tuesday, August 6, 2019 at 8:16:33 PM UTC-3, Tatu Saloranta wrote: >> >> On Tue, Aug 6, 2019 at 3:08 PM Pablo Pazos wrote: >> > >

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 me

[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] Anyone looking for easy/starter issues to help with? Java 8 date/time module has you covered :)

2019-08-12 Thread Tatu Saloranta
Quick note: I know that: (a) There are many developers who would be interested in helping with Jackson, but (b) Jackson codebase is not the easiest one to grok well enough to change things (although reproducing issues is easier) But even if changing "core" components (streaming parser/generator;

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] 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 some

[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 to

[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 n

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 betwee

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 { > >@JsonP

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' > > > While

[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 wo

[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, tha

[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) -- everyth

Re: [jackson-user] Jackson-Module-Scala - Issue #398 - Updates?

2019-09-06 Thread Tatu Saloranta
On Tue, Sep 3, 2019 at 6:29 PM Gal Naor wrote: > > Hey, > > > We would like to upgrade to scala 2.13 and use the latest > jackson-module-scala version which supports it. > > Any news about this issue? we are in concern about upgrading to the latest > version when this issue still exists. > > > T

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")); > mapper.writeValu

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

Re: [jackson-user] Custom serialization to nested JSON via annotation

2019-09-16 Thread Tatu Saloranta
On Mon, Sep 16, 2019 at 11:42 AM Wojciech Olech wrote: > > Hi, > > > I'm looking for some easy convinient way using annotations for flat object > serialization to neseted JSON, see example below: > > > class Abcde { > >String a; > >String b; > >String c; > >String d; > >String

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 > , > wh

[jackson-user] Jackson 2.10.0.pr3 -- the last pre-release version -- now out. Help with testing needed!

2019-09-17 Thread Tatu Saloranta
As per title, I pushed out 2.10.0.pr3 last night, and with Pj's help, Scala module is out too. The plan is to release actual official 2.10.0 by end of September (partly since there's new Spring Boot version planned for mid-October, so it could get 2.10.0), and I consider that solid deadline, not j

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

2019-09-19 Thread Tatu Saloranta
On Thu, Sep 19, 2019 at 6:33 AM Marc Dzaebel wrote: > > What's about deserializing polymorhic Json into an Object? E.g.: > > mapper.readValue("{\"@class\":\"java.lang.Exception\",\"message\":\"Test\"}", > Object.class).getClass() > > will be a LinkedHashMap, rather than an Exception. Is there a w

Re: [jackson-user] Illegal reflective access warning in JDK 12

2019-09-19 Thread Tatu Saloranta
On Thu, Sep 19, 2019 at 7:39 AM Juan Arjona wrote: > > Hello: > > Following the recommendation of Open JDK: > > WARNING: An illegal reflective access operation has occurred > WARNING: Illegal reflective access by > com.fasterxml.jackson.databind.util.ClassUtil (...) to method > java.lang.Throwab

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

2019-09-21 Thread Tatu Saloranta
On Sat, Sep 21, 2019 at 3:04 AM Marc Dzaebel wrote: > > Thank's Tatu, > > As you said, Jackson only deserializes polymorphically if the target type > indicates it via resolver or default typing. However, if you e.g. serialize > an object with Java writeObject and readObject again, the result has

[jackson-user] Jackson 2.9.10 patch release available

2019-09-21 Thread Tatu Saloranta
Jackson 2.9.10 is now out (with jackson-module-scala 2.9.9 to be released soon) and includes following fixes: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.9.10 most of which are polymorphic deserialization related CVEs (see https://medium.com/@cowtowncoder/on-jackson-cves-dont-pani

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

2019-09-25 Thread Tatu Saloranta
On Wed, Sep 25, 2019 at 12:35 AM Marc Dzaebel wrote: > > Hi Tatu, > > Using only ObjectMapper#enableDefaultTyping() does not serialize into a > polymorphic Json-String > Using only ObjectMapper#enableDefaultTyping() does not deserialize a > polymorphic Json-String --> error > Unexpected token (S

[jackson-user] Jackson 2.10.0 release starting -- severe problems with Sonatype OSS repository

2019-09-25 Thread Tatu Saloranta
So: I tried to start pushing Jackson 2.10.0 release, but Sonatype's Open Source Nexus repository (OSSRH) seems to have some serious issues unfortunately. While I will try to get these resolved it looks like: 1. 2.10.0 release will take longer, possible more than 24 hours 2. During this time, some

Re: [jackson-user] Throwing Classcast exception

2019-09-26 Thread Tatu Saloranta
On Thu, Sep 26, 2019 at 12:20 PM Aimaen Akief wrote: > > I am trying to use redaction for my PII information before I save it in the > server but when i initiated the code. It throws me this exception : > >## java.lang.ClassCastException: > com.fasterxml.jackson.databind.node.TextNode cannot

[jackson-user] Jackson 2.10.0 release process complete, except for an open issue with `jackson-annotations`

2019-09-26 Thread Tatu Saloranta
As per title: 2.10.0 release process is otherwise complete, including Scala module (big thanks to PJ), with one problem: 2.10.0 of `jackson-annotations` is missing some artifacts: https://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.10.0/ and this may be problematic for

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

2019-09-26 Thread Tatu Saloranta
On Thu, Sep 26, 2019 at 6:35 AM Marc Dzaebel wrote: > Same problem without AllowTypeValidator() parameter in the above code. > > -- > Have you tried calling `init()` method as suggested by exception message? That's what unit tests (see DefaultTypeResolver2472Test) do, for example. -+ Tatu +-

Re: [jackson-user] Re: Jackson 2.10.0 release starting -- severe problems with Sonatype OSS repository

2019-09-27 Thread Tatu Saloranta
eliable mechanism for making releases (and possible more convenient). Hope this helps! -+ Tatu +- > > Thanks! > Brian > > On Thursday, September 26, 2019 at 12:11:43 AM UTC-4, Tatu Saloranta wrote: >> >> So: I tried to start pushing Jackson 2.10.0 release, but Sonatype's

[jackson-user] Re: Jackson 2.10.0 release process complete, except for an open issue with `jackson-annotations`

2019-09-27 Thread Tatu Saloranta
ObjectMapper, JsonFactory". -+ Tatu +- On Thu, Sep 26, 2019 at 6:16 PM Tatu Saloranta wrote: > > As per title: 2.10.0 release process is otherwise complete, including > Scala module (big thanks to PJ), with one problem: 2.10.0 of > `jackson-annotations` is missing some artifac

Re: [jackson-user] How to use enableDefaultTyping in 2.10.0?

2019-09-27 Thread Tatu Saloranta
On Fri, Sep 27, 2019 at 2:29 AM Guido Medina wrote: > > For the following code snippet: > > public static final ObjectMapper USER_PREFS_MAPPER = > configureDefaultObjectMapper(JsonMapper.builder(SmileFactory.builder() > .disable(ENCODE_BINARY_AS_7BIT) > .enable(CHECK_SHARED_STRING_VALUES)

Re: [jackson-user] Re: How to use enableDefaultTyping in 2.10.0?

2019-09-27 Thread Tatu Saloranta
On Fri, Sep 27, 2019 at 3:43 AM Guido Medina wrote: > > Had to go back to LaissezFaireSubTypeValidator.instance as I'm getting an > exception when using the default generated by > BasicPolymorphicTypeValidator.builder().build() Yes. This is a very important point, regarding security (as per htt

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

2019-09-27 Thread Tatu Saloranta
On Thu, Sep 26, 2019 at 11:02 PM Marc Dzaebel wrote: > > You're right, forgot init(), however, the following code prints > "LinkedHashMap". If I uncomment setDefaultTyping(..) it prints "Exception" > correctly. So still, polymorphic serialisation can't be controlled for an > Object target type.

[jackson-user] Blog post (Jackson 2.10 features); continuing problems with `jackson-annotations` 2.10.0

2019-09-28 Thread Tatu Saloranta
Two quick notes. First: I spent some time to write a summary of 2.10 changes; results being here: https://medium.com/@cowtowncoder/jackson-2-10-features-cd880674d8a2 I hope you will find that useful. I hope to find time & energy to write follow ups about PolymorphicTypeValidator usage; JsonNode (

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

2019-09-30 Thread Tatu Saloranta
On Mon, Sep 30, 2019 at 1:11 AM Marc Dzaebel wrote: > Tatu, thanks for your persistent help! If my program is not correct, could > you post a sample (like in your new blog post) that simultaneously > configures an ObjectMapper to: > >- use JsonTypeInfo (without annotations) for certain types

[jackson-user] Re: Blog post (Jackson 2.10 features); continuing problems with `jackson-annotations` 2.10.0

2019-10-01 Thread Tatu Saloranta
+- On Sat, Sep 28, 2019 at 6:27 PM Tatu Saloranta wrote: > > Two quick notes. First: I spent some time to write a summary of 2.10 > changes; results being here: > > https://medium.com/@cowtowncoder/jackson-2-10-features-cd880674d8a2 > > I hope you will find that useful. I hope to

Re: [jackson-user] Writing byte[] as text to JsonGenerator

2019-10-01 Thread Tatu Saloranta
On Tue, Oct 1, 2019 at 5:10 AM Volkan Yazıcı wrote: > > Hello, > > I have a byte[] of a text. How can I write (incl. escaping) this to a > JsonGenerator. JsonGenerator#writeRawUTF8String(byte[] buffer, int offset, > int length) does the job, but misses escaping. If you need escaping, you will n

[jackson-user] Issues for New Contributors wiki page: https://github.com/FasterXML/jackson/wiki/Issues-For-New-Contributors

2019-10-01 Thread Tatu Saloranta
In honor of just-starting Hactoberfest 2019, I went ahead and: 1. Added label `new-contributor-friendly` (after some soul-searching chose this one over myriad of possibilities) in couple of repos (for yaml, java 8 date/times for first), and tagged couple of issues (java 8 had "easy", renamed that

Re: [jackson-user] Re: Jackson 2.10.0 release process complete, except for an open issue with `jackson-annotations`

2019-10-02 Thread Tatu Saloranta
on-a-fake-api > > On Thursday, September 26, 2019 at 9:16:23 PM UTC-4, Tatu Saloranta wrote: >> >> As per title: 2.10.0 release process is otherwise complete, including >> Scala module (big thanks to PJ), with one problem: 2.10.0 of >> `jackson-annotations` is missing

Re: [jackson-user] NoClassDefFoundError when I call RestTemplate.exchange() on a fake api

2019-10-02 Thread Tatu Saloranta
On Wed, Oct 2, 2019 at 2:59 PM David Guiney wrote: > > I upgraded jackson-databind lib to 2.10.0.pr3 to overcome some Veracode > vulnerabilities and now one of my tests is failing on calling > RestTemplate.exchange() on a bad api. > > The RequestEntity has a url of http://localhost:/fake/api

Re: [jackson-user] Re: Jackson 2.10.0 release starting -- severe problems with Sonatype OSS repository

2019-10-06 Thread Tatu Saloranta
On Sun, Oct 6, 2019 at 2:24 AM Steinar Bang wrote: > > >>>>> Tatu Saloranta : > > > I also think that at this point I will need to go back and really > > learn how to use Sonatype's Nexus plug-in: > > > https://blog.sonatype.com/maven-deploy-to-n

[jackson-user] Code Reviewers for Kotlin module PRs?

2019-10-10 Thread Tatu Saloranta
Hi again. I know I have asked for help with Kotlin module before, and many people have expressed interest; and a few also contributed good fixes, patches. But unfortunately I have not been good at keeping track of people who could help with the important part of gatekeeping; to do code reviews to

Re: [jackson-user] Path-like queries, with additions and substractions, in Jackson?

2019-10-15 Thread Tatu Saloranta
On Mon, Oct 14, 2019 at 9:56 PM Philip Roc wrote: > > Hello, > let's assume a JSON structure containing a list of people, each having > favorite foods, hobbies, and speaking one or more foreign languages. > I would like to retrieve data using a path-like syntax. For example: > person[0].hobbies.

Re: [jackson-user] Re: Updating JSON using Jackson Streaming API without reading everything in memory

2019-10-15 Thread Tatu Saloranta
On Mon, Oct 14, 2019 at 2:47 PM Lalit Patil wrote: > > Just to update, I tried the JSON Parser to read the nodes and modify those. > But, I am struggling with updating those nodes in the file again, because > with JSONParser, I can read, and JSONGenerator just overwrites the entire > file. I d

Re: [jackson-user] Wrong checksum in mulesoft maven repo for 2.10.0

2019-10-16 Thread Tatu Saloranta
On Wed, Oct 16, 2019 at 10:22 AM Amit Singla wrote: > > The checksum is wrong on all files in the below maven repository. This is > blocking to use this latest version. > > https://repository.mulesoft.org/nexus/content/repositories/public/com/fasterxml/jackson/core/jackson-annotations/2.10.0/ > >

Re: [jackson-user] Wrong checksum in mulesoft maven repo for 2.10.0

2019-10-17 Thread Tatu Saloranta
eally want to give enough time to get bug reports for initial problems to avoid having to spend 4-8 hours (typical time for making release) every 2 weeks. So it is likely I'll release it somewhere towards end of October. -+ Tatu +- > > On Wednesday, 16 October 2019 10:28:21 UTC-7, Tatu S

Re: [jackson-user] Wrong checksum in mulesoft maven repo for 2.10.0

2019-10-18 Thread Tatu Saloranta
t; Thank you! -+ Tatu +- > > > > On Thu, 17 Oct 2019 at 10:01, Tatu Saloranta wrote: > >> On Thu, Oct 17, 2019 at 3:56 AM Amit Singla >> wrote: >> >>> Not sure how to reach this repo out. Anyway is there any plan for next >>> release 2.10.1 or >>>

Re: [jackson-user] Re: Modify ObjectId AVRO serialization

2019-10-23 Thread Tatu Saloranta
Ok, so: if you do want `ObjectId` type handled, you will just need to provide a custom serializer (JsonSerializer), registered for that type: otherwise it is assumed to be a Bean, and properties discovered. This is probably the easiest way. If you just want to ignore all properties with value of O

Re: [jackson-user] Should we use jackson_databind 2.1.10 or 2.10

2019-10-24 Thread Tatu Saloranta
On Thu, Oct 24, 2019 at 10:51 AM Ron Karim (Oracle Corp.) wrote: > > Due to security reports, we have to replace the jackson 2.9.9.3 at the > corporate level. > > Should we go for the versino jackson_databind 2.10 or the 2.9.10 ? Not sure > if 2.10 is stable enough. We want to be careful as a l

Re: [jackson-user] Re: Modify ObjectId AVRO serialization

2019-10-25 Thread Tatu Saloranta
On Fri, Oct 25, 2019 at 8:33 PM Amit Singh wrote: > > Correct me if I am wrong, but the approach you described works well when I > want to serialize the POJO into JSON (by using a custom serializer and > overriding serialize method). However, what I actually want to achieve is > change how POJO

Re: [jackson-user] JsonParser#getCurrentLocation is not at the end of the current token, if current token is FIELD_NAME

2019-10-29 Thread Tatu Saloranta
On Tue, Oct 29, 2019 at 10:52 AM Алексей Алефиров wrote: > Hi, > > For project I'm working on, I need to get tokens from a source file with > it's start and end location. Using `JsonParser`, and it's methods > `getTokenLocation` and `getCurrentLocation` with theirs `getLineNr` and > `getColumnNr`

Re: [jackson-user] Javadoc for v. 1.8?

2019-11-11 Thread Tatu Saloranta
On Mon, Nov 11, 2019 at 11:43 AM Daniel Mönch wrote: > > Hello, > > In an enterprise legacy project, we are using Jackson in v. 1.8.2. > However, neither sources nor Javadocs are attached to the included library. > > I had no luck to find the Javadoc for this old version anywhere. Everywhere I >

Re: [jackson-user] array to object deserialization supported ?

2019-11-11 Thread Tatu Saloranta
On Mon, Nov 11, 2019 at 3:39 PM Guido Rost wrote: > > Hello jackson-user group, > > I am trying to deserialize the following json string: > > String json = > "{\"actions\":[[\"set-device-id\",[\"radius-avp\",\"nas-identifier\"]]]}"; > > > into the object: > > @JsonFormat(shape=JsonFormat.Shape.AR

Re: [jackson-user] array to object deserialization supported ?

2019-11-12 Thread Tatu Saloranta
On Mon, Nov 11, 2019 at 7:13 PM Guido Rost wrote: > > > I just posted the upper level class which contains the actions. > The target type is SetDeviceId which contains a field of type RadiusAvp. The > construction of that is the actual problem Yes, please do tell me what I really need. -+ Tatu

Re: [jackson-user] array to object deserialization supported ?

2019-11-14 Thread Tatu Saloranta
oString() { > return "set-device-id: " + radiusAvp.toString(); > } > } > > > public static void main(String[] args) throws Exception { > String json = > "{\"actions\":[[\"set-device-id\",[\"radius-a

Re: [jackson-user] array to object deserialization supported ?

2019-11-14 Thread Tatu Saloranta
So you can add logic in... I forget name of method, you can see that in `JacksonAnnotationIntrospector`. -+ Tatu +- > Thanks a lot , > Guido > > On Thursday, November 14, 2019 at 3:18:43 PM UTC-8, Tatu Saloranta wrote: >> >> By quick look, would it not work if you declare

Re: [jackson-user] @JsonBackReference with intermediate object

2019-11-15 Thread Tatu Saloranta
On Fri, Nov 15, 2019 at 6:03 AM Clément Poulain wrote: > > Hi, > > I'm trying to use @JsonManagedReference and @JsonBackReference with an > intermediate object in bewteen. > > Let's say I have those 3 objects: > > class Parent { > > Bucket childrenBucket; > > } > > class Bucke

Re: [jackson-user] Smile factory runtime exception

2019-11-15 Thread Tatu Saloranta
On Thu, Nov 14, 2019 at 2:20 AM Guido Medina wrote: > > Hi all, how can I prevent this from happening? > > Caused by: com.fasterxml.jackson.core.JsonGenerationException: Broken > surrogate pair: first char 0xD83C, second 0x002E; illegal combination > at > com.fasterxml.jackson.core.JsonGenerator

Re: [jackson-user] ObjectMapper's serialized object caching

2019-11-17 Thread Tatu Saloranta
On Sun, Nov 17, 2019 at 10:27 PM Matteo Olivi wrote: > > Hello, > Do Jackson ObjectMappers cache serialized objects? > > I'm writing a benchmark to test which serialization format is faster. For > each serialization format, one ObjectMapper for the format is instantiated > (by passing the factor

[jackson-user] Timeline for upgrading `jackson-databind` to require Java 8

2019-11-21 Thread Tatu Saloranta
Ok, time to bring this up again. So. Currently jackson-databind 2.10 may be run on JDK 7 (*). Other components differ in that jackson-annotations and jackson-core run on JDK 6, and some modules need JDK8 (Java 8 obviously, but some dataformats have deps that need Java 8 as well). Jackson 3.0 (mas

Re: [jackson-user] JDK 9+ Jackson Illegal Reflective access by ClassUtil still present in 2.10.1

2019-11-22 Thread Tatu Saloranta
On Fri, Nov 22, 2019 at 9:20 AM Mileta Cekovic wrote: > > Hi, seems JDK 9+ Illegal Reflective access by ClassUtil is still present in > Jackson 2.10.1 > Namely I got this with JDK 11.0.5, Jackson 2.10.1 then trying to serialize > LocalDate to JSON using jackson-datatype-jsr310 > > WARNING: An il

Re: [jackson-user] JDK 9+ Jackson Illegal Reflective access by ClassUtil still present in 2.10.1

2019-11-22 Thread Tatu Saloranta
On Fri, Nov 22, 2019 at 11:57 AM Tatu Saloranta wrote: > > On Fri, Nov 22, 2019 at 9:20 AM Mileta Cekovic wrote: > > > > Hi, seems JDK 9+ Illegal Reflective access by ClassUtil is still present in > > Jackson 2.10.1 > > Namely I got this with JDK 11.0.5, Jackson 2

<    2   3   4   5   6   7   8   9   10   11   >