Skip to content

Commit e77aec1

Browse files
committed
Update spring-boot version to 2.6.7 + code review.
1 parent bf4328b commit e77aec1

File tree

7 files changed

+102
-187
lines changed

7 files changed

+102
-187
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<parent>
3434
<groupId>org.springframework.boot</groupId>
3535
<artifactId>spring-boot-starter-parent</artifactId>
36-
<version>2.7.0</version>
36+
<version>2.6.7</version>
3737
</parent>
3838

3939
<licenses>

springdoc-openapi-common/src/main/java/org/springdoc/core/customizers/ActuatorOpenApiCustomizer.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,17 @@ private void handleActuatorPathParam(OpenAPI openApi) {
100100
private void handleActuatorOperationIdUniqueness(OpenAPI openApi) {
101101
Set<String> usedOperationIds = new HashSet<>();
102102
actuatorPathEntryStream(openApi, null)
103-
.sorted(Comparator.comparing(Entry::getKey))
104-
.forEachOrdered(stringPathItemEntry -> {
105-
stringPathItemEntry.getValue().readOperations().forEach(operation -> {
106-
String initialOperationId = operation.getOperationId();
107-
String uniqueOperationId = operation.getOperationId();
108-
int counter = 1;
109-
while (!usedOperationIds.add(uniqueOperationId)) {
110-
uniqueOperationId = initialOperationId + "_" + ++counter;
111-
}
112-
operation.setOperationId(uniqueOperationId);
113-
});
114-
});
103+
.sorted(Comparator.comparing(Entry::getKey))
104+
.forEachOrdered(stringPathItemEntry ->
105+
stringPathItemEntry.getValue().readOperations().forEach(operation -> {
106+
String initialOperationId = operation.getOperationId();
107+
String uniqueOperationId = operation.getOperationId();
108+
int counter = 1;
109+
while (!usedOperationIds.add(uniqueOperationId)) {
110+
uniqueOperationId = initialOperationId + "_" + ++counter;
111+
}
112+
operation.setOperationId(uniqueOperationId);
113+
}));
115114
}
116115

117116
@Override

springdoc-openapi-common/src/main/java/org/springdoc/core/providers/ObjectMapperProvider.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.fasterxml.jackson.databind.MapperFeature;
2626
import com.fasterxml.jackson.databind.ObjectMapper;
2727
import com.fasterxml.jackson.databind.SerializationFeature;
28+
import com.fasterxml.jackson.databind.json.JsonMapper;
2829
import io.swagger.v3.core.util.Json;
2930
import io.swagger.v3.core.util.Json31;
3031
import io.swagger.v3.core.util.ObjectMapperFactory;
@@ -99,9 +100,9 @@ public static ObjectMapper createJson(SpringDocConfigProperties springDocConfigP
99100
OpenApiVersion openApiVersion = springDocConfigProperties.getApiDocs().getVersion();
100101
ObjectMapper objectMapper;
101102
if (openApiVersion == OpenApiVersion.OPENAPI_3_1)
102-
objectMapper = ObjectMapperProvider.createJson31();
103+
objectMapper = ObjectMapperFactory.createJson31();
103104
else
104-
objectMapper = ObjectMapperProvider.createJson();
105+
objectMapper = ObjectMapperFactory.createJson();
105106

106107
if (springDocConfigProperties.isWriterWithOrderByKeys())
107108
sortOutput(objectMapper, springDocConfigProperties);
@@ -116,7 +117,7 @@ public static ObjectMapper createJson(SpringDocConfigProperties springDocConfigP
116117
*/
117118
public static void sortOutput(ObjectMapper objectMapper, SpringDocConfigProperties springDocConfigProperties) {
118119
objectMapper.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
119-
objectMapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
120+
JsonMapper.builder().configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
120121
if (OpenApiVersion.OPENAPI_3_1 == springDocConfigProperties.getApiDocs().getVersion()) {
121122
objectMapper.addMixIn(OpenAPI.class, SortedOpenAPIMixin31.class);
122123
objectMapper.addMixIn(Schema.class, SortedSchemaMixin31.class);

springdoc-openapi-webflux-core/src/test/resources/results/app146-1.json

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
"tags": [
2727
"Actuator"
2828
],
29-
"summary": "Actuator web endpoint 'loggers-name'",
30-
"operationId": "loggers-name",
29+
"operationId": "handle_5",
3130
"parameters": [
3231
{
3332
"name": "name",
@@ -65,8 +64,7 @@
6564
"tags": [
6665
"Actuator"
6766
],
68-
"summary": "Actuator web endpoint 'loggers-name'",
69-
"operationId": "loggers-name_2",
67+
"operationId": "handle",
7068
"parameters": [
7169
{
7270
"name": "name",
@@ -114,8 +112,7 @@
114112
"tags": [
115113
"Actuator"
116114
],
117-
"summary": "Actuator web endpoint 'threaddump'",
118-
"operationId": "threaddump",
115+
"operationId": "handle_1_1",
119116
"responses": {
120117
"200": {
121118
"description": "OK",
@@ -150,8 +147,7 @@
150147
"tags": [
151148
"Actuator"
152149
],
153-
"summary": "Actuator web endpoint 'scheduledtasks'",
154-
"operationId": "scheduledtasks",
150+
"operationId": "handle_1",
155151
"responses": {
156152
"200": {
157153
"description": "OK",
@@ -181,8 +177,7 @@
181177
"tags": [
182178
"Actuator"
183179
],
184-
"summary": "Actuator web endpoint 'metrics-requiredMetricName'",
185-
"operationId": "metrics-requiredMetricName",
180+
"operationId": "handle_2",
186181
"parameters": [
187182
{
188183
"name": "requiredMetricName",
@@ -222,8 +217,7 @@
222217
"tags": [
223218
"Actuator"
224219
],
225-
"summary": "Actuator web endpoint 'metrics'",
226-
"operationId": "metrics",
220+
"operationId": "handle_3",
227221
"responses": {
228222
"200": {
229223
"description": "OK",
@@ -253,8 +247,7 @@
253247
"tags": [
254248
"Actuator"
255249
],
256-
"summary": "Actuator web endpoint 'mappings'",
257-
"operationId": "mappings",
250+
"operationId": "handle_4",
258251
"responses": {
259252
"200": {
260253
"description": "OK",
@@ -284,8 +277,7 @@
284277
"tags": [
285278
"Actuator"
286279
],
287-
"summary": "Actuator web endpoint 'loggers'",
288-
"operationId": "loggers",
280+
"operationId": "handle_6",
289281
"responses": {
290282
"200": {
291283
"description": "OK",
@@ -315,8 +307,7 @@
315307
"tags": [
316308
"Actuator"
317309
],
318-
"summary": "Actuator web endpoint 'info'",
319-
"operationId": "info",
310+
"operationId": "handle_7",
320311
"responses": {
321312
"200": {
322313
"description": "OK",
@@ -346,8 +337,7 @@
346337
"tags": [
347338
"Actuator"
348339
],
349-
"summary": "Actuator web endpoint 'heapdump'",
350-
"operationId": "heapdump",
340+
"operationId": "handle_8",
351341
"responses": {
352342
"200": {
353343
"description": "OK",
@@ -367,8 +357,7 @@
367357
"tags": [
368358
"Actuator"
369359
],
370-
"summary": "Actuator web endpoint 'health'",
371-
"operationId": "health",
360+
"operationId": "handle_9",
372361
"responses": {
373362
"200": {
374363
"description": "OK",
@@ -398,8 +387,7 @@
398387
"tags": [
399388
"Actuator"
400389
],
401-
"summary": "Actuator web endpoint 'env-toMatch'",
402-
"operationId": "env-toMatch",
390+
"operationId": "handle_10",
403391
"parameters": [
404392
{
405393
"name": "toMatch",
@@ -439,8 +427,7 @@
439427
"tags": [
440428
"Actuator"
441429
],
442-
"summary": "Actuator web endpoint 'env'",
443-
"operationId": "env",
430+
"operationId": "handle_11",
444431
"responses": {
445432
"200": {
446433
"description": "OK",
@@ -470,8 +457,7 @@
470457
"tags": [
471458
"Actuator"
472459
],
473-
"summary": "Actuator web endpoint 'configprops-prefix'",
474-
"operationId": "configprops-prefix",
460+
"operationId": "handle_12",
475461
"parameters": [
476462
{
477463
"name": "prefix",
@@ -511,8 +497,7 @@
511497
"tags": [
512498
"Actuator"
513499
],
514-
"summary": "Actuator web endpoint 'configprops'",
515-
"operationId": "configprops",
500+
"operationId": "handle_13",
516501
"responses": {
517502
"200": {
518503
"description": "OK",
@@ -542,8 +527,7 @@
542527
"tags": [
543528
"Actuator"
544529
],
545-
"summary": "Actuator web endpoint 'conditions'",
546-
"operationId": "conditions",
530+
"operationId": "handle_14",
547531
"responses": {
548532
"200": {
549533
"description": "OK",
@@ -573,8 +557,7 @@
573557
"tags": [
574558
"Actuator"
575559
],
576-
"summary": "Actuator web endpoint 'caches-cache'",
577-
"operationId": "caches-cache",
560+
"operationId": "handle_15",
578561
"parameters": [
579562
{
580563
"name": "cache",
@@ -612,8 +595,7 @@
612595
"tags": [
613596
"Actuator"
614597
],
615-
"summary": "Actuator web endpoint 'caches-cache'",
616-
"operationId": "caches-cache_2",
598+
"operationId": "handle_19",
617599
"parameters": [
618600
{
619601
"name": "cache",
@@ -653,8 +635,7 @@
653635
"tags": [
654636
"Actuator"
655637
],
656-
"summary": "Actuator web endpoint 'caches'",
657-
"operationId": "caches",
638+
"operationId": "handle_16",
658639
"responses": {
659640
"200": {
660641
"description": "OK",
@@ -682,8 +663,7 @@
682663
"tags": [
683664
"Actuator"
684665
],
685-
"summary": "Actuator web endpoint 'caches'",
686-
"operationId": "caches_2",
666+
"operationId": "handle_18",
687667
"responses": {
688668
"200": {
689669
"description": "OK",
@@ -703,8 +683,7 @@
703683
"tags": [
704684
"Actuator"
705685
],
706-
"summary": "Actuator web endpoint 'beans'",
707-
"operationId": "beans",
686+
"operationId": "handle_17",
708687
"responses": {
709688
"200": {
710689
"description": "OK",

0 commit comments

Comments
 (0)