Skip to content

Commit 38b78d6

Browse files
committed
add test with expected result
1 parent 7af67d7 commit 38b78d6

File tree

2 files changed

+70
-1
lines changed
  • springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test

2 files changed

+70
-1
lines changed

springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/java/test/org/springdoc/api/v31/app14/HelloController.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* * * *
2222
* * *
2323
* *
24-
*
24+
*
2525
*/
2626

2727
package test.org.springdoc.api.v31.app14;
@@ -31,6 +31,8 @@
3131
import org.springdoc.core.annotations.ParameterObject;
3232

3333
import org.springframework.data.domain.Pageable;
34+
import org.springframework.data.domain.Sort;
35+
import org.springframework.data.web.PageableDefault;
3436
import org.springframework.http.ResponseEntity;
3537
import org.springframework.web.bind.annotation.GetMapping;
3638
import org.springframework.web.bind.annotation.RestController;
@@ -43,4 +45,11 @@ public ResponseEntity<List<PersonDTO>> getAllPets(@ParameterObject Pageable page
4345
return null;
4446
}
4547

48+
@GetMapping("/test1")
49+
public String getPatientList1(@PageableDefault(size = 100, sort = { "someField", "someoTHER" },
50+
direction = Sort.Direction.DESC)
51+
@ParameterObject Pageable pageable) {
52+
return "bla";
53+
}
54+
4655
}

springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results/3.1.0/app14.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,66 @@
1111
}
1212
],
1313
"paths": {
14+
"/test1": {
15+
"get": {
16+
"tags": [
17+
"hello-controller"
18+
],
19+
"operationId": "getPatientList1",
20+
"parameters": [
21+
{
22+
"name": "prefix_pages",
23+
"in": "query",
24+
"description": "One-based page index (1..N)",
25+
"required": false,
26+
"schema": {
27+
"type": "integer",
28+
"default": 1,
29+
"minimum": 0
30+
}
31+
},
32+
{
33+
"name": "prefix_sizes",
34+
"in": "query",
35+
"description": "The size of the page to be returned",
36+
"required": false,
37+
"schema": {
38+
"type": "integer",
39+
"default": 100,
40+
"minimum": 1
41+
}
42+
},
43+
{
44+
"name": "sorts",
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+
"default": [
51+
"someField,DESC",
52+
"someoTHER,DESC"
53+
],
54+
"items": {
55+
"type": "string"
56+
}
57+
}
58+
}
59+
],
60+
"responses": {
61+
"200": {
62+
"description": "OK",
63+
"content": {
64+
"*/*": {
65+
"schema": {
66+
"type": "string"
67+
}
68+
}
69+
}
70+
}
71+
}
72+
}
73+
},
1474
"/search": {
1575
"get": {
1676
"tags": [

0 commit comments

Comments
 (0)