Skip to content

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

@KimSeongJun

Description

@KimSeongJun

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions