Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Create fields companion class from all data models. #148

Open
serj-lotutovici opened this issue Aug 3, 2016 · 1 comment
Open

Create fields companion class from all data models. #148

serj-lotutovici opened this issue Aug 3, 2016 · 1 comment
Milestone

Comments

@serj-lotutovici
Copy link
Contributor

When we move the data module generation to AutoValue #137, we can add a companion class generator, that will allow to build a user fields array. This is useful for resources like UserProfilesResource where the spec accepts model fields that have to be returned by the api.

This will reduce the probability runtime bugs, when using accessing a resource.

Things to keep in mind:

  • The api accepts nested field names as well, like field1.sub_field1.sub_sub_field2 the annotation processor will have to lookup for dependent builders.
  • The generated builder like class Fields should be something like:
@GenerateFields // Name not final.
abstract class XingUser {
  abstract class Fields {
    Fields field1();
    String[] build();
  }
}
@serj-lotutovici serj-lotutovici added this to the 2.2.0 milestone Aug 3, 2016
@serj-lotutovici
Copy link
Contributor Author

cc @MyDogTom

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

No branches or pull requests

1 participant