Skip to content

Commit 8316907

Browse files
author
bnasslahsen
committed
remove pageable required. Fixes #561
1 parent ad846ee commit 8316907

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

springdoc-openapi-data-rest/src/main/java/org/springdoc/data/rest/converters/Pageable.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.util.List;
2222
import java.util.Objects;
2323

24-
import javax.validation.constraints.Max;
2524
import javax.validation.constraints.Min;
2625
import javax.validation.constraints.NotNull;
2726

@@ -33,18 +32,17 @@
3332
public class Pageable {
3433

3534
@Min(0)
36-
@Parameter(description = "Zero-based page index (0..N)",schema = @Schema(type = "integer", defaultValue = "0"),required = true)
35+
@Parameter(description = "Zero-based page index (0..N)",schema = @Schema(type = "integer", defaultValue = "0"))
3736
private Integer page;
3837

3938
@Min(1)
40-
@Max(2000)
41-
@Parameter(description = "The size of the page to be returned",schema = @Schema(type = "integer", defaultValue = "20"),required = true)
39+
@Parameter(description = "The size of the page to be returned",schema = @Schema(type = "integer", defaultValue = "20"))
4240
private Integer size;
4341

4442
@Parameter(description = "Sorting criteria in the format: property(,asc|desc). "
4543
+ "Default sort order is ascending. " + "Multiple sort criteria are supported."
4644
, name = "sort"
47-
,array = @ArraySchema(schema = @Schema(type = "string")),required = true)
45+
,array = @ArraySchema(schema = @Schema(type = "string")))
4846
private List<String> sort;
4947

5048
public Pageable(int page, int size, List<String> sort) {

springdoc-openapi-data-rest/src/test/resources/results/app2.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"format": "int32"
6565
},
6666
"size": {
67-
"maximum": 2000,
6867
"minimum": 1,
6968
"type": "integer",
7069
"format": "int32"

springdoc-openapi-data-rest/src/test/resources/results/app7.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"name": "page",
2323
"in": "query",
2424
"description": "Zero-based page index (0..N)",
25-
"required": true,
25+
"required": false,
2626
"schema": {
2727
"minimum": 0,
2828
"type": "integer",
@@ -33,9 +33,8 @@
3333
"name": "size",
3434
"in": "query",
3535
"description": "The size of the page to be returned",
36-
"required": true,
36+
"required": false,
3737
"schema": {
38-
"maximum": 2000,
3938
"minimum": 1,
4039
"type": "integer",
4140
"default": "20"
@@ -45,7 +44,7 @@
4544
"name": "sort",
4645
"in": "query",
4746
"description": "Sorting criteria in the format: property(,asc|desc). Default sort order is ascending. Multiple sort criteria are supported.",
48-
"required": true,
47+
"required": false,
4948
"schema": {
5049
"type": "array",
5150
"items": {

0 commit comments

Comments
 (0)