Skip to content

Use int32-range bounds for arrays and device counters (#145) - #196

Open
jimfengjinhua wants to merge 1 commit into
camaraproject:mainfrom
jimfengjinhua:fix-maxitems-145
Open

jimfengjinhua wants to merge 1 commit into
camaraproject:mainfrom
jimfengjinhua:fix-maxitems-145

Conversation

@jimfengjinhua

@jimfengjinhua jimfengjinhua commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

Add one of the following kinds:

  • correction

What this PR does / why we need it:

Arrays:

  • Set maxItems of the AccessDevices and Devices base schemas from 9007199254740991 to the int32 maximum (2147483647).
  • Narrow every use of them to the operative bound: the listAccessDevices page (AccessDevicesPage.items) now has minItems 0 / maxItems 100, matching perPage (maximum 100) and the other page arrays. AddedAccessDevices, CreateAccessRequest and AddDevicesRequest already narrow to minItems 1 / maxItems 100.

Device counters:

  • Change AccessStats.totalDevices, totalGranted and totalDenied and NetworkProfile.maxNumberOfDevices from int64 (maximum 9007199254740991) to int32 (maximum 2147483647), in line with the Commonalities TotalCount, which counts the same devices in the listAccessDevices pagination.

Which issue(s) this PR fixes:

Fixes #145

Special notes for reviewers:

The other bounds listed in the issue were already set to 100 by the pagination changes.

Changelog input

Use int32-range bounds for array sizes and device counters

Additional documentation

This section can be blank.

docs

)

Arrays:
- Set maxItems of the AccessDevices and Devices base schemas from
  9007199254740991 to the int32 maximum (2147483647).
- Narrow every use of them to the operative bound: the
  listAccessDevices page (AccessDevicesPage.items) now has
  minItems 0 / maxItems 100, matching perPage (maximum 100) and the
  other page arrays. AddedAccessDevices, CreateAccessRequest and
  AddDevicesRequest already narrow to minItems 1 / maxItems 100.

Device counters:
- Change AccessStats.totalDevices, totalGranted and totalDenied and
  NetworkProfile.maxNumberOfDevices from int64 (maximum
  9007199254740991) to int32 (maximum 2147483647), in line with the
  Commonalities TotalCount, which counts the same devices in the
  listAccessDevices pagination.

The other bounds listed in the issue were already set to 100 by the
pagination changes.

@tlohmar tlohmar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As agreed. Lets first go with in32 and expand, when needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

maxItems bounds are set at int64 range and inconsistent across the four APIs

2 participants