Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.0.0
-
None
-
Novice
Description
In RestOpenApiReader.class, while aggregating the tags for api-doc, the HashMap is used instead of LinkedHashMap, which breaks the original order of the tags:
if (openApi.getTags() != null) { openApi.setTags(new ArrayList<>( openApi.getTags() .stream() .collect(Collectors.toMap( Tag::getName, Function.identity(), (prev, current) -> prev)) .values())); }
A LinkedHashMap could be used instead:
if (openApi.getTags() != null) { openApi.setTags(new ArrayList<>( openApi.getTags() .stream() .collect(Collectors.toMap( Tag::getName, Function.identity(), (prev, current) -> prev, LinkedHashMap::new) .values())); }
There is no way of sorting the tags after that, and their order influences, for example, the UI of the swagger.