Re: [jackson-user] Re: convertValue ignore anySetter/anyGettter

2023-08-18 Thread Tatu Saloranta
On Wed, Aug 16, 2023 at 7:35 AM Ken Hancock wrote: > > Success. I used the setAnnotationIntrospector to essentially remove the > @JsonAnyGetter(): > > ObjectMapper mapper = new ObjectMapper(); > > mapper.setAnnotationIntrospector(new JacksonAnnotationIntrospector() { > @Override > public

Re: [jackson-user] Re: convertValue ignore anySetter/anyGettter

2023-08-16 Thread Joo Hyuk Kim (Vince)
I see, having a seperate mapper instance and disabling (sort of). Hope it solves your case ✌✌ On Wednesday, August 16, 2023 at 11:35:51 PM UTC+9 Ken Hancock wrote: > Success. I used the setAnnotationIntrospector to essentially remove the > @JsonAnyGetter(): > > ObjectMapper mapper = new

Re: [jackson-user] Re: convertValue ignore anySetter/anyGettter

2023-08-16 Thread Ken Hancock
Success. I used the setAnnotationIntrospector to essentially remove the @JsonAnyGetter(): ObjectMapper mapper = new ObjectMapper(); mapper.setAnnotationIntrospector(new JacksonAnnotationIntrospector() { @Override public Boolean hasAnyGetter(final Annotated m) { return false;

[jackson-user] Re: convertValue ignore anySetter/anyGettter

2023-08-16 Thread Ken Hancock
I think so, but that was my original question -- I couldn't figure out how to customize the master to drop that field. On Tuesday, August 15, 2023 at 9:15:49 PM UTC-4 Joo Hyuk Kim (Vince) wrote: > There was similar issue in jackson-databind >

[jackson-user] Re: convertValue ignore anySetter/anyGettter

2023-08-15 Thread Joo Hyuk Kim (Vince)
There was similar issue in jackson-databind Github , but the issue is per-class declaration usecase. If we can have a differently configured mapper, how about 1. Copy the global mapper via `mapper.copy()` 2. Add custom

[jackson-user] Re: convertValue ignore anySetter/anyGettter

2023-08-15 Thread Ken Hancock
I can't remove the @JsonAnySetter and @JsonAnyGetter as (1) those are generated automatically from the schema (2) in the nominal use case I want to preserve the additional properties It's only in one special case where I'm sending data to an external system that I need to strip them off, hence

[jackson-user] Re: convertValue ignore anySetter/anyGettter

2023-08-15 Thread Joo Hyuk Kim (Vince)
> if I drop on... Though I am not sure what you mean by "dropping on", but as far as I understood ```java SimpleObject *simpleObject *= new SimpleObject(); *simpleObject*.setSingleField("onlyField"); *simpleObject*.setAdditionalProperty("additional", "additional");

[jackson-user] Re: convertValue ignore anySetter/anyGettter

2023-08-14 Thread Ken Hancock
Hi Vince, If I'm understanding the implementation of mapper.convertVaue(), I think it doesn't matter whether it's on serialization or deserialization since convertValue() does both. To illustrate, let's say I have a pojo with one field and the anySetter/anyGetter: @JsonProperty("onlyField")

[jackson-user] Re: convertValue ignore anySetter/anyGettter

2023-08-12 Thread 김주혁
Hello Ken, To make things clear, a few questions. - Meaning of "to strip any additional properties before writing an object". Are you looking to exclude `additionalProperties` only during serialization, but include in deserialization? - Is the primary intent to generate a JSON