Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class ListTenantsResponse {
@Key("tenants")
private List<Tenant> tenants;

@Key("pageToken")
@Key("nextPageToken")
private String pageToken;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The field name pageToken is now inconsistent with the JSON key nextPageToken specified in the @Key annotation on line 33. For better code clarity and maintainability, consider renaming this field to nextPageToken. This would likely require updating the constructor and the getPageToken() method as well. If this refactoring is out of scope for this PR, it could be addressed in a follow-up.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hanges made according to it


@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void testDeserialization() throws Exception {
"tenants", ImmutableList.of(
ImmutableMap.of("name", "projects/project-id/resource/TENANT_1"),
ImmutableMap.of("name", "projects/project-id/resource/TENANT_2")),
"pageToken", "PAGE_TOKEN"));
"nextPageToken", "PAGE_TOKEN"));
ListTenantsResponse response = JSON_FACTORY.fromString(json, ListTenantsResponse.class);

assertEquals(2, response.getTenants().size());
Expand Down