Skip to content

Commit

Permalink
fix: broken example test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Chan committed Jan 11, 2024
1 parent f9eaa4f commit b01295c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ public static void main(String[] args) {
}

@GetMapping("/")
public Map<String, Object> getSequence(@RequestParam(required = false) Integer size) {
size = (size == null || size <= 0) ? 10 : size;
public Map<String, Object> getSequence(@RequestParam(name = "size", defaultValue = "10") Integer size) {
List<String> list = new ArrayList<>(size);
for (int i = 0; i < size; ++i) {
list.add(sequence.nextStr());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public static void main(String[] args) {
}

@GetMapping("/")
public Map<String, Object> getSequence(@RequestParam(required = false) Integer size) {
size = (size == null || size <= 0) ? 10 : size;
public Map<String, Object> getSequence(@RequestParam(name = "size", defaultValue = "10") Integer size) {
List<String> list = new ArrayList<>(size);
for (int i = 0; i < size; ++i) {
list.add(sequence.nextStr());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public static void main(String[] args) {
}

@GetMapping("/")
public Map<String, Object> getSequence(@RequestParam(required = false) Integer size) {
size = (size == null || size <= 0) ? 10 : size;
public Map<String, Object> getSequence(@RequestParam(name = "size", defaultValue = "10") Integer size) {
List<String> list = new ArrayList<>(size);
for (int i = 0; i < size; ++i) {
list.add(sequence.nextStr());
Expand Down

0 comments on commit b01295c

Please sign in to comment.