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

Change Return type of FieldNamingStrategy.translateName from String to List<String> for alternate. Ex. case insensitive. #1002

Open
KimSeongJun opened this issue Jan 25, 2017 · 0 comments

Comments

@KimSeongJun
Copy link

KimSeongJun commented Jan 25, 2017

To serialize/Deserialize case insensitive fieldnames,

I use annotation SerializedName like..

@SerializedName(value="fieldName",alternate={"fieldname","FIELDNAME"})

But too many @SerializedName .... I don't wanna check typo any more.

Just all i want is to case insensitive FieldNamingPolicy.. but.. no implementations..

So, reviewed some gson source, and I found ReflectiveTypeAdapterFactory is adding alternate...

but by FieldNamingStragy, just one fieldname is added to BoundField.

If FieldNamingStrategy.translateName returns List, and TypeAdapterFactory support it.

I can add case insensitive FieldNamePolicy for my own. :)

Or how about add case insensitive options?

Case insensitive fieldname policy is bad ideas? :(

Some json parser has restricted naming policy, i'ts hard to make multiple language RESTful API SDK.

@KimSeongJun KimSeongJun changed the title Change Return type of FieldNamingStrategy.translateName from String to List<String> for alternate like case insensitive. Change Return type of FieldNamingStrategy.translateName from String to List<String> for alternate. Ex. case insensitive. Jan 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants