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

Convert response model property accessors from protected to the more appropriate private for consistency #2565

Merged
merged 1 commit into from
Sep 12, 2022

Conversation

nickfloyd
Copy link
Contributor

@nickfloyd nickfloyd commented Sep 8, 2022

Apologies in advance for the size of this PR. Fortunately, the change set is a redundant change across classes.

From the issue:

As we start making our way toward generating models based on the OpenAPI definitions from the GitHub REST API, we need to do some pre-work to help us know what the result of the generated code might look like. This begins with standardization, establishing patterns, and approaches to building our models.

One area where we need to do this is with our response models. Given that most of them have constructors now, we should be able to move to a standardized way of writing these models.

Notes about the changes in this PR:

  • The existing serialization and hydration tests cover this changeset
  • Common and request models will be modified in a separate PR if needed
  • Some object properties could not be changed due to inheritance (listed below)

The following models remain unchanged due to inheritance constraints (where the protected accessor is required). We can evaluate these relationships either prior to or post generation (depending on if we approach the generation byte for byte or if it's a complete rewrite):

  • Account
  • Author
  • Authorization
  • CommitContent
  • GitReference
  • InstallationId
  • LicenseMetadata
  • SerchResults

@timrogers
Copy link
Contributor

Would these visibility changes be breaking?

@nickfloyd
Copy link
Contributor Author

Would these visibility changes be breaking?

Not at all. They are the setters that should be internal to the model, and the fields already become immutable after hydration. So no breaking changes are happening here.

@nickfloyd nickfloyd requested a review from timrogers September 9, 2022 16:38
@nickfloyd nickfloyd merged commit 9ceb188 into main Sep 12, 2022
@nickfloyd nickfloyd deleted the convert-response-model-accessors branch September 12, 2022 15:24
@nickfloyd
Copy link
Contributor Author

release_notes: Converts response model property accessors from protected to the more appropriate private for consistency

@nickfloyd nickfloyd added Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR and removed category: housekeeping labels Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Maintenance Any dependency, housekeeping, and clean up Issue or PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants