users@jsonb-spec.java.net

[jsonb-spec users] [jsr367-experts] Re: Re: Re: PropertyNamingStrategy with customized property names

From: Dmitry Kornilov <dmitry.kornilov_at_oracle.com>
Date: Sat, 30 Jan 2016 19:34:15 +0100

I agree. @JsonbProperty should override the strategy.

 

Dmitry

 

From: Romain Manni-Bucau [mailto:rmannibucau_at_tomitribe.com]
Sent: Saturday, January 30, 2016 7:18 PM
To: jsr367-experts_at_jsonb-spec.java.net
Subject: [jsonb-spec users] [jsr367-experts] Re: Re: PropertyNamingStrategy with customized property names

 

the opposite, ignore the strategy and use the annotation value




 

Romain Manni-Bucau

@rmannibucau

http://www.tomitribe.com

http://rmannibucau.wordpress.com

https://github.com/rmannibucau

 

2016-01-30 19:02 GMT+01:00 Roman Grigoriadi <roman.grigoriadi_at_oracle.com <mailto:roman.grigoriadi_at_oracle.com> >:

Hi,

you mean ignore a JsonbProperty completely? So for example a bean:

class Pojo {
    @JsonbProperty("appropriateName")
    String propertyWithInaproppriateName;
}

would become "property_with_inaproppriate_name" when naming strategy is set?

Thanks,
Roman

 

On 01/30/2016 06:22 PM, Romain Manni-Bucau wrote:

Hi

I'd ignore explicit property and just use the strategy in default case.

Le 30 janv. 2016 18:04, "Roman Grigoriadi" <roman.grigoriadi_at_oracle.com <mailto:roman.grigoriadi_at_oracle.com> > a écrit :

Hi experts!

My name is Roman, I am currently working on JSONB RI.

I need clarification about PropertyNamingStragegy. Should property naming strategy "override" property names explicitly set by @JsonbProperty annotation?

For example, when marshalling class:

class Pojo {
    @JsonbProperty("updatedName")
    String propertyWithSomeName;
}

should a resulting json key name for a property, with a PropertyNamingStrategy.LOWER_CASE_WITH_UNDERSCORES set globally, be "updatedName" or "updated_name"?

Thank you,
Roman