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

Question: Enum, codegen and proguard #1147

Closed
glureau-betclic opened this issue May 26, 2020 · 1 comment
Closed

Question: Enum, codegen and proguard #1147

glureau-betclic opened this issue May 26, 2020 · 1 comment

Comments

@glureau-betclic
Copy link

Trying to use an enum with Moshi-kotlin-codegen (1.9.2).

enum class LevelDto {
    @Json(name = "low") low,
    @Json(name = "high") high
}

This version is not safe for proguard, but I'm not sure if I should add a @Keep (or a proguard rule to preserve all enums) or a @JsonAdapter(generateAdapter = false). The only "documentation" that I found points to use the latter, but it's 2 years old so I'd have a confirmation if possible.

# Annotate enums with @JsonClass(generateAdapter = false) to use them with Moshi.

If it's still right, maybe editing the README.md could help future users?

@ZacSweers
Copy link
Collaborator

Feel free to send a PR to the README!

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

2 participants