Skip to content

Commit ee57e00

Browse files
committed
Redunant(wrong) direction appended to @PageableDefault. Fixes #2152
1 parent 8415e5e commit ee57e00

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

springdoc-openapi-data-rest/src/test/java/test/org/springdoc/api/app13/HelloController.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,14 @@ public String getPatientList4(@PageableDefault(100)
6363
@ParameterObject Pageable pageable) {
6464
return "bla";
6565
}
66+
67+
@GetMapping("/test5")
68+
public void read(
69+
@PageableDefault(sort = {
70+
"some,desc",
71+
"other,asc",
72+
"another.that,desc"
73+
})
74+
@ParameterObject final Pageable pageable) {
75+
}
6676
}

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

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,60 @@
1111
}
1212
],
1313
"paths": {
14+
"/test5": {
15+
"get": {
16+
"tags": [
17+
"hello-controller"
18+
],
19+
"operationId": "read",
20+
"parameters": [
21+
{
22+
"name": "page",
23+
"in": "query",
24+
"description": "Zero-based page index (0..N)",
25+
"required": false,
26+
"schema": {
27+
"minimum": 0,
28+
"type": "integer",
29+
"default": 0
30+
}
31+
},
32+
{
33+
"name": "size",
34+
"in": "query",
35+
"description": "The size of the page to be returned",
36+
"required": false,
37+
"schema": {
38+
"minimum": 1,
39+
"type": "integer",
40+
"default": 10
41+
}
42+
},
43+
{
44+
"name": "sort",
45+
"in": "query",
46+
"description": "Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported.",
47+
"required": false,
48+
"schema": {
49+
"type": "array",
50+
"items": {
51+
"type": "string"
52+
},
53+
"default": [
54+
"some,desc",
55+
"other,asc",
56+
"another.that,desc"
57+
]
58+
}
59+
}
60+
],
61+
"responses": {
62+
"200": {
63+
"description": "OK"
64+
}
65+
}
66+
}
67+
},
1468
"/test4": {
1569
"get": {
1670
"tags": [

0 commit comments

Comments
 (0)