Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@SerializedName not being ignored since 2.x is bug or feature? #1036

Closed
ghost opened this issue Feb 3, 2019 · 3 comments
Closed

@SerializedName not being ignored since 2.x is bug or feature? #1036

ghost opened this issue Feb 3, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 3, 2019

Q A
Bug report? maybe?

In issue #334 it was stated, that @SerializedName being ignored, when IdenticalPropertyNamingStrategy is set, is not a bug...

But since version 2.x the behavior is, that @SerializedName is always taken into account no matter naming strategy - is that now a bug or a feature? I liked the behavior of 1.x more.

@goetas
Copy link
Collaborator

goetas commented Feb 3, 2019 via email

@ghost
Copy link
Author

ghost commented Feb 3, 2019

Well it kind of made sense, that IdenticalPropertyNamingStrategy will map properties identically no matter what and that I have a choice to make the annotation work if needed. I've actually found use case for that behavior because I am using 2 instances with different settings - to map data from database to entity and then to send entity to frontend - and some column names slighty differed from that in entity (so the annotation helped to get data loaded from database, but then identical naming strategy used to send it to frontend as is). But fixing that was not a problem, I just made sure that the entity attributes fit the database ones.

I don't have a problem with how it is now, because I altered the code to it, I just wanted to make sure this is what you intended and it is not a bug (since the behavior is different from previous version)

@goetas
Copy link
Collaborator

goetas commented Feb 3, 2019

#334 was a bug and some people were expecting it to work as it is now (see #334 (comment)).

When @serializedname is specified, it is honored. So the current way it the expected way.

I'm closing the issue since it seems that your question has been answered.

@goetas goetas closed this as completed Feb 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant