Ignore Annotation for Methods
naturalwarren opened this issue · 6 comments
Would you be open to a PR that adds an @Ignore
annotation that AVM would use to discard annotated fields in its generated adapter? AFAIK this doesn't exist.
Related Moshi issue here #94.
@rharter and I have talked in the past about making a public annotations artifact with some common serialization annotations (since av-gson has a form of this already). I think we should just do that rather than fragment further, then av-moshi can just support the same annotations.
You could use @Transient from the lazy adapters. Also there's SerializeOnly as well as DeserializeOnly.
I'm not sure we'd want to pull that library into AVM, the surface area looks pretty large. If the annotations were separate that might make sense.
You don't need to add this in here. It'll work with autovalue out of the box. You can see that in the integration tests.
Yep I think that's actually a better recommended solution. I forgot that existed. Pretty much a perfect example of moshi's annotation support, and doesn't require this library to know anything about it.
Ah great. I'll close this out then. Thanks @vanniktech and @hzsweers.