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

Moshi code gen should warn about referencing an Enum that does not have @JsonClass to avoid R8 issues #1910

Open
yogurtearl opened this issue Nov 26, 2024 · 1 comment

Comments

@yogurtearl
Copy link
Contributor

When using R8 we want to keep everything that is used by code gen'd adapters, including all the value of enums referenced.

This works fine if you put @JsonClass on all the enums used in JSON, but it is easy to miss that.

I propose that Moshi code gen issue a warning or and error if any @JsonClass references an enum that is not marked with @JsonClass

@ZacSweers
Copy link
Collaborator

We use lint checks for this at slack, which are a little more configurable. We open sourced our Moshi lints here: GitHub.com/slackhq/slack-lints

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