johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Sandtner <reinhard.sandt...@gmail.com>
Subject Re: Apache Johnzon JsonbPropertyOrder behavior different from eclipse yasson.
Date Wed, 20 Jun 2018 13:49:05 GMT
hey,

afaik the spec pdf and the javadoc-jar of JSR-367 are differing

the pdf says to use renamed fields and the javadoc says to use the java fields names :(

so imo we need clarification in the spec  

lg
reini


> Am 20.06.2018 um 15:02 schrieb Romain Manni-Bucau <rmannibucau@gmail.com>:
> 
> Hi Ravi,
> 
> Thanks to have sent the mail ;)
> 
> for others: I asked Ravi to send this mail (he pinged on twitter) because
> this can be a breaking change so not sure we want to directly impl it or
> push it back to the spec. Any opinion welcomed.
> 
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://rmannibucau.metawerx.net/> | Old Blog
> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau>
|
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> <https://www.packtpub.com/application-development/java-ee-8-high-performance>
> 
> 
> Le mer. 20 juin 2018 à 15:01, Ravisankar Challa <ravisankar2@gmail.com> a
> écrit :
> 
>> Hi Devs,
>> 
>> I got something form here
>> https://github.com/eclipse-ee4j/yasson/issues/23
>> 
>> It Says
>> 
>> Properties names specified in @jsonbpropertyorder annotation must be the
>> original names of properties as it’s specified in Java class.
>> 
>> as per yasson it should be
>> @JsonbPropertyOrder({" lName", " fName"})
>> class Person {
>>    @JsonbProperty("last_name")
>>    public String lName;
>>    @JsonbProperty("first_name")
>>    public String fName;
>> }
>> 
>> But Johnzon uses the renamed fields.
>> 
>> as per spec it should be
>> @JsonbPropertyOrder({" last_name", " first_name"})
>> class Person {
>>    @JsonbProperty("last_name")
>>    public String lName;
>>    @JsonbProperty("first_name")
>>    public String fName;
>> }
>> 
>> Thanks,
>> Ravi
>> 


Mime
View raw message