From c97b5452e04e8ead6614b495f17030d964b9c993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danny=20Gr=C3=A4f?= Date: Tue, 23 Apr 2024 13:00:05 +0100 Subject: [PATCH] Fixed order for default OpenAPI security responses --- .../openapi/deployment/filter/AutoRolesAllowedFilter.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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