Skip to content

server: report a provider list maxResults that is not an integer - #125

Closed
littlegrasscao wants to merge 1 commit into
mainfrom
server/max-results-param
Closed

littlegrasscao wants to merge 1 commit into
mainfrom
server/max-results-param

Conversation

@littlegrasscao

Copy link
Copy Markdown
Collaborator

Summary

  • the provider list endpoints (GET /shares, GET /shares/{share}/permissions and GET /recipients) took maxResults as an Integer, which Armeria parses before the endpoint runs, so a value such as ten was 400 with Java's parse message (For input string: "ten")
  • new Pagination.maxResults reads the query parameter instead: a value that is not an integer is 400 INVALID_PARAMETER_VALUE with the message maxResults must be an integer, and an empty value counts as unset
  • the endpoints now take maxResults as a string and read it through Pagination.maxResults; the paging rules are unchanged
  • the recipient protocol list endpoints (OpenSharing protocol: authenticate recipients and list granted shares #101 onwards) reuse the same helper

Testing

  • mvn clean verify: 127 tests passed
  • ProviderMaxResultsTest: ten, 1.5 and an out-of-range 3000000000 are 400 with the new message on all three lists, and an empty maxResults lists as if unset

@littlegrasscao
littlegrasscao added this pull request to stack #126 October 21, 2026 21:30
@littlegrasscao
littlegrasscao removed this pull request from stack #126 October 21, 2026 21:36
@littlegrasscao

Copy link
Copy Markdown
Collaborator Author

Dropped: the provider and protocol list endpoints keep the typed @PARAM Integer maxResults; a non-integer value is already 400 INVALID_PARAMETER_VALUE, and only the message wording would differ.

@littlegrasscao
littlegrasscao deleted the server/max-results-param branch October 21, 2026 21:36
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.

1 participant