File tree 5 files changed +108
-30
lines changed
springdoc-openapi-starter-common/src/main/java/org/springdoc/core
springdoc-openapi-tests/springdoc-openapi-data-rest-tests/src/test/resources/results
5 files changed +108
-30
lines changed Original file line number Diff line number Diff line change 27
27
import java .util .Optional ;
28
28
29
29
import org .springdoc .core .converters .SortOpenAPIConverter ;
30
+ import org .springdoc .core .converters .models .SortObject ;
30
31
import org .springdoc .core .customizers .DataRestDelegatingMethodParameterCustomizer ;
31
32
import org .springdoc .core .customizers .DelegatingMethodParameterCustomizer ;
32
33
import org .springdoc .core .providers .ObjectMapperProvider ;
@@ -71,6 +72,7 @@ public class SpringDocSortConfiguration {
71
72
@ Lazy (false )
72
73
SortOpenAPIConverter sortOpenAPIConverter (ObjectMapperProvider objectMapperProvider ) {
73
74
getConfig ().replaceParameterObjectWithClass (org .springframework .data .domain .Sort .class , org .springdoc .core .converters .models .Sort .class );
75
+ getConfig ().replaceWithClass (org .springframework .data .domain .Sort .class , SortObject .class );
74
76
return new SortOpenAPIConverter (objectMapperProvider );
75
77
}
76
78
Original file line number Diff line number Diff line change
1
+ /*
2
+ *
3
+ * *
4
+ * * *
5
+ * * * *
6
+ * * * * * Copyright 2019-2022 the original author or authors.
7
+ * * * * *
8
+ * * * * * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * * * * * you may not use this file except in compliance with the License.
10
+ * * * * * You may obtain a copy of the License at
11
+ * * * * *
12
+ * * * * * https://www.apache.org/licenses/LICENSE-2.0
13
+ * * * * *
14
+ * * * * * Unless required by applicable law or agreed to in writing, software
15
+ * * * * * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * * * * * See the License for the specific language governing permissions and
18
+ * * * * * limitations under the License.
19
+ * * * *
20
+ * * *
21
+ * *
22
+ *
23
+ */
24
+ package org .springdoc .core .converters .models ;
25
+
26
+ import com .fasterxml .jackson .annotation .JsonProperty ;
27
+
28
+ /**
29
+ * The type Sort response.
30
+ * @author bnasslahsen
31
+ */
32
+ public class SortObject {
33
+
34
+ /**
35
+ * The Direction.
36
+ */
37
+ @ JsonProperty
38
+ private String direction ;
39
+
40
+ /**
41
+ * The Null handling.
42
+ */
43
+ @ JsonProperty
44
+ private String nullHandling ;
45
+
46
+ /**
47
+ * The Ascending.
48
+ */
49
+ @ JsonProperty
50
+ private boolean ascending ;
51
+
52
+ /**
53
+ * The Property.
54
+ */
55
+ @ JsonProperty
56
+ private String property ;
57
+
58
+ /**
59
+ * The Ignore case.
60
+ */
61
+ @ JsonProperty
62
+ private boolean ignoreCase ;
63
+
64
+ }
Original file line number Diff line number Diff line change @@ -403,7 +403,7 @@ public final class Constants {
403
403
/**
404
404
* The constant SPRINGDOC_SORT_CONVERTER_ENABLED.
405
405
*/
406
- public static final String SPRINGDOC_SORT_CONVERTER_ENABLED = "springdoc.model-converters. sort-converter.enabled" ;
406
+ public static final String SPRINGDOC_SORT_CONVERTER_ENABLED = "springdoc.sort-converter.enabled" ;
407
407
408
408
/**
409
409
* The constant SPRINGDOC_NULLABLE_REQUEST_PARAMETER_ENABLED.
Original file line number Diff line number Diff line change 90
90
"type" : " integer" ,
91
91
"format" : " int64"
92
92
},
93
- "numberOfElements" : {
94
- "type" : " integer" ,
95
- "format" : " int32"
96
- },
97
93
"size" : {
98
94
"type" : " integer" ,
99
95
"format" : " int32"
108
104
"type" : " integer" ,
109
105
"format" : " int32"
110
106
},
111
- "pageable" : {
112
- "$ref" : " #/components/schemas/PageableObject"
113
- },
114
107
"sort" : {
115
108
"$ref" : " #/components/schemas/SortObject"
116
109
},
110
+ "numberOfElements" : {
111
+ "type" : " integer" ,
112
+ "format" : " int32"
113
+ },
114
+ "pageable" : {
115
+ "$ref" : " #/components/schemas/PageableObject"
116
+ },
117
117
"first" : {
118
118
"type" : " boolean"
119
119
},
132
132
"type" : " integer" ,
133
133
"format" : " int64"
134
134
},
135
+ "sort" : {
136
+ "$ref" : " #/components/schemas/SortObject"
137
+ },
135
138
"pageNumber" : {
136
139
"type" : " integer" ,
137
140
"format" : " int32"
140
143
"type" : " integer" ,
141
144
"format" : " int32"
142
145
},
143
- "sort" : {
144
- "$ref" : " #/components/schemas/SortObject"
145
- },
146
- "unpaged" : {
146
+ "paged" : {
147
147
"type" : " boolean"
148
148
},
149
- "paged " : {
149
+ "unpaged " : {
150
150
"type" : " boolean"
151
151
}
152
152
}
153
153
},
154
154
"SortObject" : {
155
155
"type" : " object" ,
156
156
"properties" : {
157
- "sorted" : {
158
- "type" : " boolean"
157
+ "direction" : {
158
+ "type" : " string"
159
+ },
160
+ "nullHandling" : {
161
+ "type" : " string"
159
162
},
160
- "unsorted " : {
163
+ "ascending " : {
161
164
"type" : " boolean"
162
165
},
163
- "empty" : {
166
+ "property" : {
167
+ "type" : " string"
168
+ },
169
+ "ignoreCase" : {
164
170
"type" : " boolean"
165
171
}
166
172
}
Original file line number Diff line number Diff line change 58
58
"Pageable" : {
59
59
"type" : " object" ,
60
60
"properties" : {
61
- "paged" : {
62
- "type" : " boolean"
61
+ "offset" : {
62
+ "type" : " integer" ,
63
+ "format" : " int64"
63
64
},
64
- "unpaged " : {
65
- "type " : " boolean "
65
+ "sort " : {
66
+ "$ref " : " #/components/schemas/SortObject "
66
67
},
67
68
"pageNumber" : {
68
69
"type" : " integer" ,
72
73
"type" : " integer" ,
73
74
"format" : " int32"
74
75
},
75
- "offset" : {
76
- "type" : " integer" ,
77
- "format" : " int64"
76
+ "paged" : {
77
+ "type" : " boolean"
78
78
},
79
- "sort " : {
80
- "$ref " : " #/components/schemas/SortObject "
79
+ "unpaged " : {
80
+ "type " : " boolean "
81
81
}
82
82
}
83
83
},
84
84
"SortObject" : {
85
85
"type" : " object" ,
86
86
"properties" : {
87
- "sorted" : {
88
- "type" : " boolean"
87
+ "direction" : {
88
+ "type" : " string"
89
+ },
90
+ "nullHandling" : {
91
+ "type" : " string"
89
92
},
90
- "unsorted " : {
93
+ "ascending " : {
91
94
"type" : " boolean"
92
95
},
93
- "empty" : {
96
+ "property" : {
97
+ "type" : " string"
98
+ },
99
+ "ignoreCase" : {
94
100
"type" : " boolean"
95
101
}
96
102
}
You can’t perform that action at this time.
0 commit comments