Skip to content

Commit bf583a5

Browse files
authored
Merge pull request #13 from Amartus/issue09
Fix for #9
2 parents c4efc98 + 317165f commit bf583a5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

‎src/main/java/com/amartus/sonata/blender/impl/postprocess/PropertyPostProcessor.java

+4-8
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@
2323
import io.swagger.v3.oas.models.media.Schema;
2424
import org.apache.commons.lang3.text.WordUtils;
2525

26-
import java.util.Collection;
27-
import java.util.Collections;
28-
import java.util.List;
29-
import java.util.Map;
30-
import java.util.Optional;
31-
import java.util.stream.Collectors;
26+
import java.util.*;
3227
import java.util.stream.Stream;
3328

29+
import static com.amartus.sonata.blender.impl.util.Collections.mapCollector;
30+
3431
/**
3532
* Abstract OAS API property postprocessor.
3633
* It traverse all properties from schemas (including compose schemas).
@@ -47,8 +44,7 @@ protected void process(String type, Schema schema) {
4744
Map<String, Schema> properties = toProperties(schema)
4845
.entrySet().stream()
4946
.map(e -> processProperty(e.getKey(), e.getValue()))
50-
51-
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
47+
.collect(mapCollector());
5248
schema.setProperties(properties);
5349
if (schema instanceof ComposedSchema) {
5450
schemas(((ComposedSchema) schema).getAllOf())

0 commit comments

Comments
 (0)