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

Can SerialName annotation support alternate? #203

Closed
chenfei0928 opened this issue Aug 30, 2018 · 9 comments
Closed

Can SerialName annotation support alternate? #203

chenfei0928 opened this issue Aug 30, 2018 · 9 comments

Comments

@chenfei0928
Copy link

Can SerialName annotation support alternate?
Like Gson's SerializedName annotation.

@ToxicBakery
Copy link

I'm actually in need of this as well. One thing I don't really like about gson's is the API for it personally. I would propose, if possible, that this implementation just use a single parameter overloaded constructor like

@SerialName("Example")
@SerialName(listOf("Example", "example"))

// or if var args are acceptable
@SerialName("Example", "example")

@Zeta611
Copy link

Zeta611 commented Feb 18, 2020

This would be awesome!

@tjohnn
Copy link

tjohnn commented Feb 28, 2020

@ToxicBakery I don't think the api you are suggesting will work well for stringifying, gson is using value and alternate so it can use the value's value for transforming to json from an object. Except you're suggesting they use the first value from the list, which will end up being confusing.

@ToxicBakery
Copy link

I don't see that as an issue. I'll settle for having support at all though regardless of the API 😄

@andro-jedi
Copy link

Any updates on this feature? Waiting for it too.

@Vivecstel
Copy link

Any news ?

@mochadwi
Copy link

mochadwi commented Jul 1, 2020

Any updates?

Edited: they're working on it here #597

@qwwdfsad
Copy link
Member

qwwdfsad commented Jul 10, 2020

It will be likely supported in the upcoming releases, but in a JSON specific.
Please keep track of that issue here: #203
EDIT: in #597

@sandwwraith
Copy link
Member

Fixed by #1375

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

9 participants