swagger-core
swagger-core copied to clipboard
Default value for Parameter annotation
I'm trying to set a default value for one of my query params, but the Parameter annotation doesn't have defaultValue. I tried using the prop schema and pass the value but it doesn't work. Is it a bug or am I doing something wrong? This is the example of what I'm trying to do: When I was using Swagger version 2, It was working with ApiImplicitParams annotation.
@GetMapping(path = "/user", produces = JSON_FORMAT)
public ResponseEntity<PagedListDto<List<UserOutputDto>>> getUsers(
@Parameter(description = DEFAULT_PAGE_DESCRIPTION, schema = @Schema(defaultValue = DEFAULT_PAGE))
@RequestParam(defaultValue = DEFAULT_PAGE) Integer page,
@Parameter(description = DEFAULT_LIMIT_DESCRIPTION, schema = @Schema(defaultValue = DEFAULT_LIMIT))
@RequestParam(defaultValue = DEFAULT_LIMIT) Integer limit) {
...
}
+1, This seems like a weird oversight
+1
+1
+1