From 86c2ba79cb119cd2ca4ddf365ed303d45c686d5a Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Thu, 6 Oct 2022 18:33:40 +0300 Subject: [PATCH] Ensure that build time writers are properly sorted This is needed because there were cases where the built-in providers could be returned before the application ones. --- .../org/jboss/resteasy/reactive/common/core/Serialisers.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/core/Serialisers.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/core/Serialisers.java index 3f0b755be1ab0..72a0a6bb5d1e3 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/core/Serialisers.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/common/core/Serialisers.java @@ -151,7 +151,9 @@ public List> findBuildTimeWriters(Class entityType, Runt } } - return toMessageBodyWriters(findResourceWriters(writers, klass, produces, runtimeType)); + var resourceWriters = findResourceWriters(writers, klass, produces, runtimeType); + resourceWriters.sort(new ResourceWriter.ResourceWriterComparator(produces)); + return toMessageBodyWriters(resourceWriters); } protected List findResourceWriters(QuarkusMultivaluedMap, ResourceWriter> writers, Class klass,