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

Allow custom opt-in annotation for factory #245

Closed
ZacSweers opened this issue Jan 28, 2020 · 2 comments
Closed

Allow custom opt-in annotation for factory #245

ZacSweers opened this issue Jan 28, 2020 · 2 comments

Comments

@ZacSweers
Copy link
Collaborator

Since we allow opting in to a factory via no parameters, we should designate something other than the autovalue annotation as an opt-in mechanism for it since a no-arg method would obviously not be using auto-value-gson-extension's generated adapter. This also allows users to use something other than auto-value, or at least use auto-value without necessarily generating the adapter.

@rharter
Copy link
Owner

rharter commented Feb 3, 2020

I'm having a hard time understanding this. The idea is that user's who don't use AutoValue can opt into the having their Gson TypeAdapter's automatically picked up by the AutoValue: Gson generated type factory? That seems out of scope, and something that should be provided by another library, if not Gson itself. Is there something I'm missing?

@ZacSweers
Copy link
Collaborator Author

Yeah that’s the idea, with the motivation being that the factory could support this since it’s a separate artifact now. The example case I ran into for this internally was one where we had a project for all of our models and most of them use the extension but one requires it’s own custom adapter. It’s nice not to have to manually wire that custom adapter separately from the rest of the models already being wired up by the factory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants