Re: [jackson-user] Dynamic Json - Deserialization

2016-06-15 Thread Tatu Saloranta
There is no current functionality for inferring type from structure or values of JSON Objects. Something like that has been requested, but it is difficult to both think of how to generalize this (is there a declarative way of defining what and how to match?) as well as how to make it work through

Re: [jackson-user] Change in handling of enum when moving from 2.6 to 2.7

2016-06-15 Thread Tatu Saloranta
Since `XmlEnumValue` is a JAXB annotation, it is used if (and only if) JAXB module is included. `@JsonProperty` is applied through standard `jackson-databind`. Precedence of annotations depends on how `AnnotationIntrospector`s are registered (which has precedence). I assume that you have JAXB

Re: [jackson-user] java.lang.VerifyError when using jackson-module-scala_2.11

2016-07-25 Thread Tatu Saloranta
Actually I don't think your problem is related to Jackson 1.x usage, since you are trying to use 2.7.5 version of Scala module, which requires 2.x base components. 1.x and 2.x components reside in different Java packages and have different Maven group ids so they do not collide. However it seems

Re: [jackson-user] Re: Custom Error Handler for invalid objects in JSON array

2016-07-28 Thread Tatu Saloranta
Right, this isn't kind of use case for which there is (or likely will) be special handling; for better functionality you may need to both use 2-pass processing (first bind individual sub-trees to a JsonNode, or Map or TokenBuffer) and custom error handling (for each generic subtree). In general

Re: [jackson-user] Deprecated findSerializationType might be breaking refineSerializationType (v2.8.1)

2016-08-11 Thread Tatu Saloranta
Your suggestion sounds plausible, but to fix it, as well as to guard against regression, it would be necessary to have a way to reproduce the problem. So if there is any way you could suggest a way to trigger the problem that would be great. Exception, however, would seem to indicate some other

Re: [jackson-user] How to access TypeResolutionContext in jackson 2.8.1

2016-08-09 Thread Tatu Saloranta
On Tue, Aug 9, 2016 at 3:03 AM, JonyD wrote: > Hi, > I will repost the question I did in stackoverflow ( > http://stackoverflow.com/questions/38797189/how-to- > access-typeresolutioncontext-in-jackson-2-8-1). > > > I am upgrading jackson library in a java project from

Re: [jackson-user] JsonIdentityInfo and serializing ObjectId references - expected a field name

2016-07-13 Thread Tatu Saloranta
This definitely sounds like a bug in Jackson; exception itself indicates that the state Jackson databind thinks it is in (wrt what is to be written) differs from what low-level JSON generator thinks. If possible, could you file a bug at https://github.com/FasterXML/jackson-databind/issues but

Re: [jackson-user] StackOverflowError in deeply nested JSON

2016-07-06 Thread Tatu Saloranta
Thank you! -+ Tatu +- On Fri, Jul 1, 2016 at 10:05 AM, Colin White <colinrtwh...@gmail.com> wrote: > Thanks for the response. I'll take a closer look into the allocations on > the stack and report back. > > -Colin > > > On Thursday, 30 June 2016 22:33:41 UTC-7, Tat

Re: [jackson-user] JsonMappingException: Can not resolve PropertyFilter with id

2016-07-06 Thread Tatu Saloranta
I can't think of anything obvious. Since registration occurs via REST framework of some kind, it would seem like maybe registration is failing for some reason? Sometimes framework uses different `ObjectMapper` than user expects, leading to missing configuration. -+ Tatu +- On Thu, Jun 30, 2016

Re: [jackson-user] Globally deserialize with underscore/hyphen/case insensitivity

2016-07-06 Thread Tatu Saloranta
There is no way to do this; you can have case-insensitive properties, or regular conversion (given POJO property, produce translated expected external value), but no arbitrary conversions applied on-the-fly. To support such mapping you would need to do 2-phase processing: first read content and

[jackson-user] Jackson 2.8.0 released (scala module to follow)

2016-07-05 Thread Tatu Saloranta
As per title, I have pushed 2.8.0 release out (with JAX-RS provider being synced to Maven Central now). As usual, Scala module should follow with some delay, but otherwise core components are released. Release notes can be found from: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.8

Re: [jackson-user] com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 10))

2016-06-30 Thread Tatu Saloranta
If content does indeed contain character 10 (Unicode), that is, linefeed, it is prohibited by JSON specification (should be escaped as \n), so the content should be fixed and parser is right to report it. This is assuming content does have that; cut'n pasting JSON can not quite tell that, so you'd

Re: [jackson-user] Add support to "required" attribute in non creator parameters

2016-08-16 Thread Tatu Saloranta
Unfortunately I don't think this approach will work due to overhead being added: just looking at code it would make all existing usage measurably slower. And for case where there are actually required properties there's even more due to construction and management of the Map. There are other

Re: [jackson-user] Inconsistent jackson databinding behavior.[Fasterxml/databinding issue]

2017-01-31 Thread Tatu Saloranta
I can not think of anything specific in this area that would cause such problems. The first thing I would strongly recommend, however, is to upgrade to the latest patch of the minor version you have: there is absolutely no reason to use 2.6.1 over latest one, 2.6.7. If the problem still

Re: [jackson-user] Construct type for class implementing List bound to specific generic type

2017-02-02 Thread Tatu Saloranta
Ok, code has a few problems. First: method `constructFromCanonical()` really isn't meant to be end-user functionality. Maybe Javadocs should make this clear, but it is not something I was planning to be used by anything but core Jackson functionality. I can sort of see why it might seem useful,

[jackson-user] Jackson 2.7.9 patch release process started

2017-02-04 Thread Tatu Saloranta
So far pushed out core components (annotations, streaming, databind), base modules. Will proceed with dataformats, datatypes and then languages (kotlin, scala). As usual, process may take a while. This is likely to be the last 2.7.x release for a while; it may even be the last patch. But branch

Re: [jackson-user] How to send a Java object form client (written in Java) to server (written in C) and print values ?

2017-01-29 Thread Tatu Saloranta
Yes, you can serialize a Java object as CBOR using Jackson's `jackson-dataformat-cbor` as extension of `jackson-databind`. As you would know by reading the README at: https://github.com/FasterXML/jackson-dataformats-binary/tree/master/cbor it's something like: ObjectMapper mapper = new

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

Re: [jackson-user] ProGuard

2017-01-26 Thread Tatu Saloranta
Since this has been asked a few times (every now and then), it would be great if existing settings could be shared -- I am pretty sure they do exist. This would help developers on Android platform. A section for `jackson-docs` or just README of `jackson` dedicated to things to consider on Android

Re: [jackson-user] Serialize Generic Collection Issues

2017-01-25 Thread Tatu Saloranta
stance.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

Re: [jackson-user] Avro: Is is possible to serialize multiple objects to a file?

2017-01-24 Thread Tatu Saloranta
Apologies for a slow response here: yes, once this: https://github.com/FasterXML/jackson-dataformats-binary/issues/35 gets into release (2.7.9 and 2.8.7) this will work using `SequenceWriter`, like so: SequenceWriter w = mapper.writer(schema) .writeValues(file); w.write(item1);

[jackson-user] Jackson 2.8.7 patch release in progress

2017-02-20 Thread Tatu Saloranta
As per title, 2.8.7 is being released. Change list at: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.8.7 and upgrade is, as usual, recommended; although nothing considered generally critical fix was included this time (YMMV of course). We are also getting very close to 2.9.0.pr1;

Re: [jackson-user] Custom deserializing Map<String, Foo> where Foo is polymorphic

2017-02-20 Thread Tatu Saloranta
Almost but not quite. Use of `@JsonTypeInfo(include=As.WRAPPER_OBJECT)` would indeed allow use of JSON property name as type identitifier. This would work for property values, and Lists/Arrays, but not quite the way you'd want for Maps. So if I understand use case correctly, there is nothing out

Re: [jackson-user] Serialization of any object with parent-child relationships without outputing the ID value

2017-02-17 Thread Tatu Saloranta
tion it may not be possible to just omit value (f.ex. in case property is to be serialized, name is already written); except if property itself is to be excluded (using `@JsonInclude` mechanism for example). -+ Tatu +- > > Thanks > > David > > > On Friday, February 17, 2017 at 1:49:4

Re: [jackson-user] Serialization of any object with parent-child relationships without outputing the ID value

2017-02-17 Thread Tatu Saloranta
if I understand use case. -+ Tatu +- > > Thanks > > David > > > > > > On Thursday, February 16, 2017 at 4:40:19 PM UTC-6, Tatu Saloranta wrote: >> >> On Thu, Feb 16, 2017 at 1:43 PM, David Hayek <david...@sial.com> wrote: >> > If I have to se

Re: [jackson-user] jackson jax-rs providers and custom serializer and deserializer

2017-02-17 Thread Tatu Saloranta
Usually my first guess is that configured `ObjectMapper` is not being used at all. So if you can re-configure mapper in some other way (like default to indenting or something) maybe you can eliminated the possibility that this mapper is not being used? Another small thing is that

Re: [jackson-user] Type information missing due to cached serializer

2017-02-23 Thread Tatu Saloranta
On Thu, Feb 23, 2017 at 5:33 AM, wrote: > Hello, > > I have the following scenario: > > * Map > > * CustomClass contains a field Map, and has a > CustomClassSerializer registered in module added to the ObjectMapper > > * the

Re: [jackson-user] jackson jax-rs providers and custom serializer and deserializer

2017-02-18 Thread Tatu Saloranta
didn't work. >> >> What do you meant by "re-configure mapper in some other way". Could you >> please provide some more details? >> My guess is that JacksonJsonProvider is not getting used at all. How do >> you I know that? >> >> -Ni

Re: [jackson-user] com.fasterxml.jackson.core.JsonParseException: Unexpected end-of-input within/between Array entries

2017-02-18 Thread Tatu Saloranta
Um, how are we supposed to help if you don't provide either: 1. Classes you use for reading/writing 2. JSON being read (or expected to be written) ? Including list of symptoms may help but these two things are the most important. -+ Tatu +- On Fri, Feb 17, 2017 at 1:54 PM, vivek sharma

Re: [jackson-user] Android - Problem deserialising JSON to object in 'release' builds

2017-02-13 Thread Tatu Saloranta
ode. > > Jonathan > > On Friday, 10 February 2017 19:19:59 UTC, Tatu Saloranta wrote: >> >> I have not heard of such problem. >> >> But make sure NOT to disable `FAIL_ON_UNKNOWN_PROPERTIES` >> DeserializationFeature -- (too) many developers auto

Re: [jackson-user] Using a converter only on root object/collection

2017-02-13 Thread Tatu Saloranta
erModifier.modifySerializer() called for > Collection? Because `modifyCollectionSerializer()` is called for it; they are type-specific. -+ Tatu +- > > Thanks, > > On Tuesday, February 7, 2017 at 8:28:56 PM UTC+1, Tatu Saloranta wrote: >> >> There is no functionality to d

Re: [jackson-user] How best to migrate old objects

2017-02-09 Thread Tatu Saloranta
I don't know of any specific facility, and since Jackson specifically stays of Transformation use cases (with some minor exceptions for simple unwrapping), it may be out of scope for automated handling. Having said that I would think a common pattern would be to read input as tree (`JsonNode`),

Re: [jackson-user] Error deserializing to object

2017-02-09 Thread Tatu Saloranta
That sounds like an odd result. From code it looks like simple valid usage that sound not fail. Are you using a recent Jackson version? (2.7.9 or 2.8.6) -+ Tatu +- On Wed, Feb 8, 2017 at 9:44 PM, Solar Entropy wrote: > Not entirely sure where to ask for help with this,

Re: [jackson-user] ObjectMapper configuration: multiple POJO's using a custom Shape

2017-02-15 Thread Tatu Saloranta
On Wed, Feb 15, 2017 at 11:38 AM, Mike Price wrote: > I am currently attempting to implement some of the tricks described in this > presentation to increase performance. I would like to be able to change a > particular ObjectMapper instance to serialize all POJO's using a

Re: [jackson-user] Serialization of any object with parent-child relationships without outputing the ID value

2017-02-16 Thread Tatu Saloranta
On Thu, Feb 16, 2017 at 1:43 PM, David Hayek wrote: > If I have to serialize an object that I can not annotate and that contains > parent-child relationship, such as a DefaultMutableTreeNode, I can avoid the > infinite recursion/stack overflow problem by supplying an

Re: [jackson-user] @JsonInclude is ignored when using BeanSerializerModifier

2017-01-16 Thread Tatu Saloranta
Ignored in what way? What is happening? What does your `JsonViewOverrideSerializer` look like? One common problem is that all delegating serializers MUST implement `ResolvableSerializer` and `ContextualSerializer`, and delegate them to underlying serializer -- otherwise that instance can not be

[jackson-user] Working on improving Jackson Avro module, feedback appreciated

2017-01-20 Thread Tatu Saloranta
Although Jackson has had Avro backend for quite a while -- in fact, it was introduced in 2.1, over 4 years ago -- it hasn't been widely adopted, and feature-wise there has been much development aside from bug fixes (big thank you to all adopters who have reported them!). Lately there have been a

Re: [jackson-user] Is there an annotation similar to @JsonCreator for setters that accept more than one parameter?

2017-01-20 Thread Tatu Saloranta
No, currently there is no way to have what amounts to multiple-argument setters. From annotation perspective it should be possible to just use `@JsonSetter` for such methods, but internally those are not yet supported. They would be nice to support, but would likely require lots of work due to

Re: [jackson-user] jackson-databind uses compact2 profile

2017-02-28 Thread Tatu Saloranta
What is compact1 profile? -+ Tatu +- On Mon, Feb 27, 2017 at 3:13 AM, Ferry Huberts wrote: > I would really like to run the jackson bundles under compact1 profile for my > JSON serialisation. > > Is it possible to adjust the databind bundle so that it only uses the >

Re: [jackson-user] Re: Receiving JSON data from POST

2017-02-28 Thread Tatu Saloranta
Looking at the exception output, interesting part is this: at [Source: start_date=28%2F02%2F2017+14%3A01_date=01%2F03%2F2017+14%3A03_date=01%2F03% which gets printed because input comes as a String (otherwise wouldn't print, although Jackson 2.9 does improve on this a bit). So input that is

Re: [jackson-user] Sporadic deserialization failure with abstract class

2016-09-06 Thread Tatu Saloranta
Behavior does sound like a concurrency problem, but I do not recall anything specific that should cause it. I do know there have been fixes to some concurrency issues related to type resolution so this could be the root cause. There are no currently open bug reports for this, as far as I know.

[jackson-user] Re: [jackson-dev] Jackson 2.8.2 being released

2016-08-30 Thread Tatu Saloranta
.7, 2.8.1 (no 2.8.0 > release due to incompatibilities), and 2.8.2. They should be available on > maven central within a few hours. > > On Tue, Aug 30, 2016 at 12:31 AM Tatu Saloranta <t...@fasterxml.com> > wrote: > >> Quick note: after releasing 2.7.7 patch release last we

Re: [jackson-user] How to filter out fields based on a dynamic condition?

2016-09-12 Thread Tatu Saloranta
On Mon, Sep 12, 2016 at 9:30 AM, Clément Poulain wrote: > > >> I think there are many ways to build filters, including cases where you >> have a small number of filters, but each with complicated logic. One >> possible problem is that of passing settings/configuration into

Re: [jackson-user] How to write a custom list deserializer with automatic type inference like CollectionDeserializer?

2016-09-12 Thread Tatu Saloranta
Adding custom Collection deserializers is possible, but it is quite a bit more involved due to delegation needed. Best examples of how this is done would probably be found from `jackson-datatype-guava` package, which has support for Immutable lists and sets. You may also want to have a look

[jackson-user] Jackson 2.8.3 released (Scala to follow)

2016-09-18 Thread Tatu Saloranta
Quick note: I just finished pushing patch version 2.8.3. Release notes can be found here: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.8.3 Upgrade is recommended from earlier 2.8.x versions. Scala version is not yet out, but our hope is that it can be release within upcoming week

Re: [jackson-user] Releases

2016-09-27 Thread Tatu Saloranta
Nothing definitive, but in general: 1. Releases wiki page -- https://github.com/FasterXML/jackson/wiki/Jackson-Releases -- and explicit sub-pages do get updated 2. We try to tweet via @fasterxml 3. There is also `jackson-announce` mailing list (alas, not reliable used) I would be interested in

[jackson-user] Jackson 2.7.8 patch release out

2016-09-27 Thread Tatu Saloranta
Patch release 2.7.8 is now out, as per: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.7.8 (minus some inertia wrt Scala module, to follow) Although upgrades from earlier patch versions is always recommended -- we try to keep risk for patch versions very low, and unlike issues with

Re: [jackson-user] How to read/write encoded characters

2016-11-10 Thread Tatu Saloranta
This is tricky, and in general there isn't way to force "raw" inclusion for pass-through data: content must be first decoded from XML, and re-encoded. It would not be possible via Stax, even with direct access. However, question of escaping '>' (which Woodstox only does if it's part of "]]>", as

Re: [jackson-user] Replacing a custom resolver with @JsonSubTypes

2016-10-14 Thread Tatu Saloranta
The only thing is @JsonTypeInfo(defaultImpl=...) which would be used if nothing is found or matches. -+ Tatu +- On Fri, Oct 14, 2016 at 8:01 AM, Benson Margulies wrote: > Note the fallback if statement here. Is there a way to do an @Type > that says what to do if nothing

Re: [jackson-user] About @JsonProperty, @JsonGetter and @JsonSetter

2016-10-14 Thread Tatu Saloranta
You can think of `@JsonGetter` and `@JsonSetter` mostly as old aliases for `@JsonProperty`. So you shouldn't have to them for anything. And yes, annotated getter/field for serialization (to access property value), setter/constructor-parameter/field for deserialization (to assign). Beyond this,

Re: [jackson-user] Re: Json Schema V4 issue with virtual property

2016-10-14 Thread Tatu Saloranta
I don't think schema generation / type introspection aspects have been tested with virtual properties, so you are exploring uncharted territory here. Most likely some wiring is missing. As usual, a github issue with simple repo would be good way to go. -+ Tatu +- On Fri, Oct 14, 2016 at 6:12

Re: [jackson-user] Problem pretty printing a String of Json

2016-10-14 Thread Tatu Saloranta
Java String just becomes JSON String value, that is, surrounded in double quotes and contents escaped if and as necessary. So to pretty-print, you need to parse JSON into a Java object structure, then write with pretty-printing. Something like: JsonNode root = mapper.readTree(input); String

Re: [jackson-user] JsonIgnore annotation is not documented well

2016-11-22 Thread Tatu Saloranta
Thank you for reporting this: I will update documentation as suggested! -+ Tatu +- On Mon, Nov 7, 2016 at 3:23 AM, Alexander Mironenko wrote: > Hi all, > > Just found the behaviour relate to JsonIgnore annotation. The cause is > described here:

[jackson-user] Jackson 2.8.5 release in progress: dataformats, JAX-RS, Scala still to be completed

2016-11-15 Thread Tatu Saloranta
As some of you may have noticed, I started pushing Jackson 2.8.5 patch release yesterday. Core components are out, as well as datatypes, base modules, and half of dataformats. I still need to figure out one thing wrt binary dataformats but hope to push them tonight (within 12 hours); after which

Re: [jackson-user] Re: How to read/write encoded characters

2016-11-11 Thread Tatu Saloranta
Oh. Actually, never mind that one. I should have checked the link first -- this is for JSON output. What Woodstox offers is, as per issue you filed (thanks!) property `P_TEXT_ESCAPER`. Wiring this via `CharacterEscapes` would be the clean way. Until then, this thread:

Re: [jackson-user] Getting lexical information in the tree model?

2016-11-13 Thread Tatu Saloranta
No, for two reasons: 1. JsonNode is singly linked, only parent -> child linkage (not a problem for root node itself, but in general) 2. JsonNode does not have JsonLocation, since this is not needed in general to get location information, you need to use JsonParser directly, or sub-class JsonNode

Re: [jackson-user] [jackson-datatype-jdk8] Optional default value

2016-11-01 Thread Tatu Saloranta
field has type Optional assign > Optional.empty() instead of assign null > > On Tuesday, October 25, 2016 at 12:55:48 AM UTC+3, Tatu Saloranta wrote: >> >> What do you mean by optional fields? Optional values are usually defined >> by assigning them in POJO. >>

Re: [jackson-user] Set DateFormat

2016-10-12 Thread Tatu Saloranta
rmat' when mapping data across multiple > threads ? Where exactly is this done ? > A new instance is created with a clone; no sharing is done. If you want to see where, have a look at code. -+ Tatu +- > > > > Thanks, > Mohan > > On Wednesday, 12 October 201

Re: [jackson-user] Json data with xml as string for field.

2016-11-29 Thread Tatu Saloranta
No, you'll have to handle it on your own; possibly by using separate `XmlMapper` for values. -+ Tatu +- On Mon, Nov 28, 2016 at 11:28 PM, wrote: > How do I parse a json containing xml as string in one of the field. > > Pojo: >class A { > B b; > int

Re: [jackson-user] Register custom TypeIdResolver on ObjectMapper without using JsonTypeIdResolver annotation

2016-11-29 Thread Tatu Saloranta
Unfortunately handling of TypeIdResolver is quite strongly coupled with that of `TypeResolverBuilder`, and your best route would probably be via annotation introspector. Although I actually like your approach above: did not know it would actually work (I spent some time back in the day trying to

[jackson-user] Re: [jackson-dev] Re: Jackson 2.8.5 release in progress: dataformats, JAX-RS, Scala still to be completed

2016-12-08 Thread Tatu Saloranta
Everything else done a long ago. Not sure what Scala status is. -+ Tatu +- On Thu, Dec 8, 2016 at 1:02 PM, Steve A. <a.steven.ander...@gmail.com> wrote: > What's the lastest status on 2.8.5 esp. wrt scala? > > On Tuesday, November 15, 2016 at 2:36:10 PM UTC-5, Tatu

Re: [jackson-user] Type info is not serialized when a @JsonTypeInfo element is a part of a collection or map

2016-12-15 Thread Tatu Saloranta
On Thu, Dec 15, 2016 at 8:13 AM, Lev Kuznetsov wrote: > But why would the type erasure on the map be the deciding factor here? The > type of the value is known at runtime, it is Bar, it has a property lol - > that gets serialized no problem, clearly it knows the type

Re: [jackson-user] Re: serializing POJOs

2016-12-15 Thread Tatu Saloranta
First: how would you know how many have seen your message? Just because there are no answers does not mean much: mailing lists messages are sent as emails and there is no way to track that. It is possible that Web UI has separate counts. Second: what's with the entitlement? Do you really expect

Re: [jackson-user] examples of Full data binding - converting from Java bean to JSON string

2016-12-15 Thread Tatu Saloranta
On Thu, Dec 15, 2016 at 11:47 AM, Literate Aspects wrote: > How can take my remote data (generated by a Model class bean and a remote > data connect bean displayed in xhtml VIEW [live xhtml VIEW][1]) and convert > -- that POJO into a JSON string -- to use in jquery

Re: [jackson-user] Deserialize/Serialize an Object in two different ways

2016-12-15 Thread Tatu Saloranta
That should work: you do need 2 separate ObjectMappers, and a way to change polymorphic type inclusion. If using default typing it's simple (just setting for mapper), but otherwise need to apply changes to settings. Options I would have suggested include: 1. Use of mix-in annotations (to add or

Re: [jackson-user] Type info is not serialized when a @JsonTypeInfo element is a part of a collection or map

2016-12-14 Thread Tatu Saloranta
The reason for (4) is the good old Java Type Erasure. What you writing out is essentially `Map`, as far as available type information tells -- there is nothing that could tell otherwise. So as general rule: - Do not serialize generic values as root value, if possible. o but if you do, you

Re: [jackson-user] Behaviour change in jackson-databind TypeFactory affecting attempted upgrade in swagger-core

2016-12-12 Thread Tatu Saloranta
For sake of completeness (full desc in issue filed): there is no way to match the behavior with code, because usage can not be fully supported. This was not known at the time API was left open. The underlying issue is that generic `java.lang.reflect.Type` types can only be fully and reliably

Re: [jackson-user] Deserializing @JsonUnwrapped fields with @JsonCreator annotated constructors

2017-01-12 Thread Tatu Saloranta
vement has been made yet. > > Of course not using @JsonUnwrapped is not an option here :) > > Thanks for your help in any case! Likewise! -+ Tatu +- > > Le mercredi 11 janvier 2017 21:53:14 UTC+1, Tatu Saloranta a écrit : >> >> On Wed, Jan 11, 2017 at 3:45 AM, <v

[jackson-user] Re: [jackson-dev] On vacation until Jan 4, 2017

2017-01-05 Thread Tatu Saloranta
, Tatu Saloranta <tsalora...@gmail.com> wrote: > Quick note: I am now on vacation, and while I may be checking (and > occasionally responding) my emails, I won't be working on any issues. I will > be checking the backlog in january so no reason not to file bugs, add > updates

Re: [jackson-user] How to deserialize a generic class with two parameters?

2017-01-08 Thread Tatu Saloranta
JavaType construction itself looks ok. So that should not be causing the problem. Without seeing more of code it is hard to know what could be causing the issue: so a code snippet that contains call to `readValue()` (or even better unit test) would be needed to resolve the issue. -+ Tatu +- On

Re: [jackson-user] Serialize specific field list only (at runtime)

2017-01-08 Thread Tatu Saloranta
There is no built-in support for specifically filtering out named fields, although doing this using @JsonFilter should be possible. It's briefly explained at: http://www.cowtowncoder.com/blog/archives/2011/02/entry_443.html and in bit more detail at:

[jackson-user] On vacation until Jan 4, 2017

2016-12-20 Thread Tatu Saloranta
Quick note: I am now on vacation, and while I may be checking (and occasionally responding) my emails, I won't be working on any issues. I will be checking the backlog in january so no reason not to file bugs, add updates, but my follow-up will be slower than usual. Happy holiday season to

Re: [jackson-user] WRAP_ROOT_VALUE when serializing

2017-03-23 Thread Tatu Saloranta
You can enable/disable `SerializationFeature`s using `ObjectWriter` instead of `ObjectMapper`, like so: byte[] bytes = mapper.writer().with(SerializationFeature.WRAP_ROOT_VALUE) .writeValueAsBytes(pojo); I don't know what support Spring Boot offers for doing this. -+ Tatu +- On Mon, Mar

Re: [jackson-user] Ignore property of object in list property of a class

2017-03-23 Thread Tatu Saloranta
Actually it should already be possible to use `@JsonIgnoreProperties` for properties as is, but I think it only affects property value itself, and not contents of containers. But it seems reasonable to assume that since Lists/arrays/Maps do not have properties of their own (except in non-standard

Re: [jackson-user] How to use type name as element name

2017-03-23 Thread Tatu Saloranta
terXML/jackson-docs/ but most documentation refers to public API developers are most likely to use. -+ Tatu +- > > BR, Zsolt > > 2017. március 23., csütörtök 6:45:18 UTC+1 időpontban Tatu Saloranta a > következőt írta: >> >> On Wed, Mar 22, 2017 at 10:24

Re: [jackson-user] JsonMappingException with jackson-databind version 2.8.0 and higher

2017-03-23 Thread Tatu Saloranta
Could you please file an issue for `jackson-databind`. Looks like a bug. -+ Tatu +- On Thu, Mar 23, 2017 at 5:11 PM, Anuj Kumar wrote: > > I am getting an exception with jackson databind version 2.8.0 and later, > everything works fine with any version below 2.8.0. > > Issue

Re: [jackson-user] How to use type name as element name

2017-03-27 Thread Tatu Saloranta
L module, as that should be slightly more robust. > > > > > > > > > Thanks for your help and hints! Hope I helped someone... Thank you for sharing this! -+ Tatu +- > > BR, Zsolt > > 2017. március 24., péntek 1:06:37 UTC+1 időpontb

Re: [jackson-user] How to use type name as element name

2017-03-22 Thread Tatu Saloranta
e it has to something with the fact that I register it for an abstract > class, and the concrete implementors still use their defaults? BeanSerializerModifier is a callback, but yes, result would be bound for whatever type it was called for. -+ Tatu +- > > BR Zsolt > > > > 2017. má

Re: [jackson-user] Changing object type in JSON Schema

2017-03-28 Thread Tatu Saloranta
JSON Schema reflects the fact that Jackson serializes URLs as JSON Strings -- it wouldn't make much sense to report it as Object since that is not its serialization. So this part works the way I would expect it to be: JSON Schema defines the way JSON structures work, not what is semantic view of

Re: [jackson-user] Re: How to access default serializer when writing custom serialiser

2017-03-20 Thread Tatu Saloranta
PM, Zsolt Balanyi <zsolt.bala...@gmail.com> wrote: > Hi! > > OK, thanks, then I'll go that way! > > BR, Zsolt > > 2017. március 20., hétfő 20:13:25 UTC+1 időpontban Tatu Saloranta a > következőt írta: >> >> This can not be done from annotation-based serializer

Re: [jackson-user] Re: How to access default serializer when writing custom serialiser

2017-03-20 Thread Tatu Saloranta
sed in annotation like this: > @JsonSerialize(using = UIElementSerializer.class) > > BR, Zsolt > > 2017. március 20., hétfő 19:21:29 UTC+1 időpontban Tatu Saloranta a > következőt írta: >> >> Not 100% sure I understand the question, but if you want to access >> informati

Re: [jackson-user] How to use type name as element name

2017-03-20 Thread Tatu Saloranta
y I have a Page, that contains a StackLayout that contains a > Label and an Image. > It would solve the problem, if the JsonTypeInfo could put the type name to > the element name... > > BR, Zsolt > > 2017. március 20., hétfő 19:22:10 UTC+1 időpontban Tatu Saloranta a >

Re: [jackson-user] Jackson and XHTML

2017-03-15 Thread Tatu Saloranta
com > > > > On Wed, Mar 15, 2017 at 7:34 PM, Tatu Saloranta <t...@fasterxml.com> wrote: >> >> That does sound like a possible path, as >> InputDecorator/OutputDecorator allow wrapping of parser/generator >> using delegation. >> Implementation o

Re: [jackson-user] How to use type name as element name

2017-03-20 Thread Tatu Saloranta
What is the POJO you are serializing? -+ Tatu +- On Mon, Mar 20, 2017 at 5:11 AM, Zsolt Balanyi wrote: > Hi! > > I have a structure that outputs this: > > > > > > > > > I use @JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=As.PROPERTY, >

Re: [jackson-user] Jackson CSV: Edit header at first row of csv

2017-03-20 Thread Tatu Saloranta
Ok so what do you mean by "edit"? Change the effect taken, or to modify file from which data comes? Or something else? -+ Tatu +- On Fri, Mar 17, 2017 at 9:50 PM, Public Share wrote: > Hi, > > > I'm using jackson csv to write csv file. > But the header is mapping

Re: [jackson-user] Limiting object depth and collection length during serialization for 3rd party classes

2017-03-20 Thread Tatu Saloranta
I hope someone who has had similar issue can share how they implemented limitations. -+ Tatu +- On Wed, Mar 15, 2017 at 9:40 PM, <ni...@codenation.co.in> wrote: > Thanks for the quick reply. Are there workarounds to implement these? > > On Thursday, March 16, 2017 at 1:45:06 AM

Re: [jackson-user] Re: How to access default serializer when writing custom serialiser

2017-03-20 Thread Tatu Saloranta
Not 100% sure I understand the question, but if you want to access information about annotations on property, from your custom serializer, you need to implement `ContextualSerializer`, and then its `createContextual()` gets called with `BeanProperty`. `BeanProperty` has accessors for annotation

Re: [jackson-user] Limiting object depth and collection length during serialization for 3rd party classes

2017-03-15 Thread Tatu Saloranta
There is no such functionality available for either aspects. First one is unlikely to be supported at all as the delegation means that none of serializers is concerned with more than one level (or, possibly another small fixed number considering wrapping for type id handling, or "unwrapped"

Re: [jackson-user] Jackson and XHTML

2017-03-15 Thread Tatu Saloranta
>> >> >> On Mon, Mar 13, 2017 at 10:38 AM, <st...@heliossoftware.com> wrote: >> > Thank you Tatu. If I were to try to override this behavior, where >> > should I >> > look in Jackson? For example, if I wanted to try to have Jackson skip >&

Re: [jackson-user] ignore namespace during json to java conversion

2017-04-11 Thread Tatu Saloranta
On Tue, Apr 11, 2017 at 12:25 AM, Adarsh Jalaja wrote: > I am trying to send json to convert to java via rest using apache CXF > (3.0.11) > > jackson being used is 2.8.6. > > when I send the plain JSON (without namespace) its giving namespace related > error. This used to

Re: [jackson-user] Using json annotations with jackson and jax-rs on weblogic 12.2

2017-04-03 Thread Tatu Saloranta
I am not an expert with Weblogic, but I suspect there may be some dependency that includes component that prevents use of Jackson. So... On Tue, Mar 28, 2017 at 2:32 AM, Claude Libois wrote: > Hello, > I have been fighting since yesterday to enforce the simple pojo to me

Re: [jackson-user] setCurrentValue/getCurrentValue() in XmlReadContext class not implemented

2017-04-12 Thread Tatu Saloranta
Already done: https://github.com/FasterXML/jackson-dataformat-xml/issues/228 but will be part of 2.9.0(.pr3) If anyone observes similarly missing functionality for other context please file issues: unfortunately this change needs to be rolled out incrementally. -+ Tatu +- On Wed, Apr 12,

Re: [jackson-user] Graceful Error Handling/Collection on Databind (2.9.0.pr2)

2017-04-20 Thread Tatu Saloranta
On Thu, Apr 20, 2017 at 1:28 PM, Andrew Joseph wrote: > > I'm looking to simply return null and add errors to a > Map from all JsonDeserializer instances when a > JsonMappingException is encountered (since the JSON parser can continue). In > each of

Re: [jackson-user] Graceful Error Handling/Collection on Databind (2.9.0.pr2)

2017-04-21 Thread Tatu Saloranta
s are called in expected place(s) and are responsible for trying to keep token stream in compatible state: this is why `skipChildren()` is called for some of the cases. Throwing exceptions generally cuts through call hierarchy and tends to make nested deserializers get off expected state. So choices tend

Re: [jackson-user] Jackson and XHTML

2017-03-13 Thread Tatu Saloranta
Jackson XML backend does not really support mixed content -- content model that has both non-whitespace text AND elements. This is difficult to represent with databinding, and is mostly operated with XML-centric models like DOM. There has been some talk about exposing this in some form or

Re: [jackson-user] Jackson XML :: Serialized differs from the original

2017-03-06 Thread Tatu Saloranta
The problem with your code is that you are for some reason assuming that `user` would be dropped for some reason: it is not. JSON structure that would be equivalent is rather: { "user" : { "name" : "Joe", "age" : 28 } } So basically there is no 'age' property in main level object:

Re: [jackson-user] jackson-databind uses compact2 profile

2017-03-06 Thread Tatu Saloranta
2:14:27 AM UTC+1, Tatu Saloranta wrote: >> >> What is compact1 profile? > > > See > http://docs.oracle.com/javase/8/docs/technotes/guides/compactprofiles/compactprofiles.html > > -- > You received this message because you are subscribed to the Google Groups > &qu

Re: [jackson-user] deserialization context and path parameters in an http context

2017-03-01 Thread Tatu Saloranta
Jackson databind has no idea where calls comes from, so by default no. JAX-RS provider could theoretically pass this information, but this has not been wired. I think you could build something using `ObjectReaderModifier` and `ObjectReaderInjector` to pass information from endpoint, using

Re: [jackson-user] JsonUnwrapped & camel cased properties

2017-08-02 Thread Tatu Saloranta
On Mon, Jul 31, 2017 at 3:34 PM, Drpbxa wrote: > When you annotate a property with @JsonUnwrapped you can set a prefix > attribute: > > @JsonUnwrapped(prefix="camel") > MyObject obj; > > If MyObject has a property named "casedProperty", the json key will be named >

Re: [jackson-user] XML deserialization : same localname but differents namespaces.

2017-08-02 Thread Tatu Saloranta
On Thu, Jul 20, 2017 at 6:06 AM, Adrien Quentin wrote: > Hello, > > I'm trying to use jackson deserialization to parse and map java object. > Work fine except when the xml contains two same local names in differents > namespaces, like this : > > > > > > > > > Borehole

  1   2   3   4   5   6   7   8   >