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

Builders for all models #66

Open
Tomboyo opened this issue Feb 10, 2023 · 0 comments
Open

Builders for all models #66

Tomboyo opened this issue Feb 10, 2023 · 0 comments

Comments

@Tomboyo
Copy link
Owner

Tomboyo commented Feb 10, 2023

Request body objects can contain optional fields, and will acquire optional fields over time as an API evolves. Developers who have written code against an earlier version of an API should not have to "update" that code to explicitly set a new and optional field to null when they update to a newer version of the API.

The only solution I am aware of in Java is to create builders:

MyRequestBody.newBuilder()
  .foo("foo!")
  .build();

The user might construct response objects or any other type in their test suite (or maybe even in server code, if they use this to generate their model), and we wouldn't want that to break with a version upgrade, either. So we pretty much ought to add builders everywhere.

@Tomboyo Tomboyo converted this from a draft issue Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant