Skip to content

Commit

Permalink
fix(request): Properly declare optional request parameters
Browse files Browse the repository at this point in the history
Optional is not the right way to declare that a particular request
parameter is not required. There was a similar issue in the corresponding
clouddriver endpoint that was fixed by
spinnaker/clouddriver#6067
  • Loading branch information
Daniel Zheng authored and dzhengg committed Dec 14, 2023
1 parent 7349a74 commit 39218f3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ class CredentialsController {
@ApiParam(value = 'Value of the "@type" key for accounts to search for.', example = 'kubernetes')
@PathVariable String accountType,
@ApiParam('Maximum number of entries to return in results. Used for pagination.')
@RequestParam OptionalInt limit,
@RequestParam(required = false, defaultValue = "100") Integer limit,
@ApiParam('Account name to start account definition listing from. Used for pagination.')
@RequestParam Optional<String> startingAccountName
@RequestParam(required = false) String startingAccountName
) {
clouddriverService.getAccountDefinitionsByType(accountType, limit.isPresent() ? limit.getAsInt() : null, startingAccountName.orElse(null))
clouddriverService.getAccountDefinitionsByType(accountType, limit, startingAccountName)
}

@PostMapping
Expand Down

0 comments on commit 39218f3

Please sign in to comment.