diff --git a/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/filter/AutoRolesAllowedFilter.java b/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/filter/AutoRolesAllowedFilter.java index de5fed2dae14b..2873b039cbabb 100644 --- a/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/filter/AutoRolesAllowedFilter.java +++ b/extensions/smallrye-openapi/deployment/src/main/java/io/quarkus/smallrye/openapi/deployment/filter/AutoRolesAllowedFilter.java @@ -2,6 +2,7 @@ import java.util.Collection; import java.util.Collections; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Objects; @@ -146,9 +147,10 @@ private void addDefaultSecurityResponses(Operation operation, Map getSecurityResponses() { - return Map.of( - "401", OASFactory.createAPIResponse().description("Not Authorized"), - "403", OASFactory.createAPIResponse().description("Not Allowed")); + Map responses = new LinkedHashMap<>(); + responses.put("401", OASFactory.createAPIResponse().description("Not Authorized")); + responses.put("403", OASFactory.createAPIResponse().description("Not Allowed")); + return responses; } } \ No newline at end of file