diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ad46052ca..b79376e39 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,13 +1,13 @@ [versions] -micronaut = "4.5.4" -micronaut-platform = "4.3.1" +micronaut = "4.6.1" +micronaut-platform = "4.5.1" micronaut-docs = '2.0.0' -micronaut-test = "4.0.1" +micronaut-test = "4.4.0" micronaut-data = "4.9.0" -micronaut-sql = "5.7.0" +micronaut-sql = "5.8.1" micronaut-security = "4.9.1" -micronaut-serde = "2.10.2" -micronaut-validation = "4.6.1" +micronaut-serde = "2.11.0" +micronaut-validation = "4.7.0" micronaut-gradle-plugin = "4.4.2" managed-freemarker = "2.3.33" managed-handlebars = "4.3.1" diff --git a/views-htmx/src/main/java/io/micronaut/views/htmx/http/HtmxResponseRawMessageBodyHandler.java b/views-htmx/src/main/java/io/micronaut/views/htmx/http/HtmxResponseRawMessageBodyHandler.java index d1070c4bb..b5f10a3a5 100644 --- a/views-htmx/src/main/java/io/micronaut/views/htmx/http/HtmxResponseRawMessageBodyHandler.java +++ b/views-htmx/src/main/java/io/micronaut/views/htmx/http/HtmxResponseRawMessageBodyHandler.java @@ -17,40 +17,33 @@ import io.micronaut.core.annotation.Internal; import io.micronaut.core.annotation.NonNull; -import io.micronaut.core.annotation.Nullable; -import io.micronaut.core.io.buffer.ByteBuffer; import io.micronaut.core.type.Argument; -import io.micronaut.core.type.Headers; import io.micronaut.core.type.MutableHeaders; import io.micronaut.http.HttpHeaders; import io.micronaut.http.HttpRequest; import io.micronaut.http.MediaType; -import io.micronaut.http.body.RawMessageBodyHandler; +import io.micronaut.http.body.MessageBodyWriter; import io.micronaut.http.codec.CodecException; import io.micronaut.http.context.ServerRequestContext; import io.micronaut.views.ModelAndView; import io.micronaut.views.ModelAndViewRenderer; import io.micronaut.views.exceptions.ViewRenderingException; import jakarta.inject.Singleton; -import org.reactivestreams.Publisher; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; -import java.util.Collection; -import java.util.Collections; /** - * {@link RawMessageBodyHandler} implementation for {@link HtmxResponse}. + * {@link io.micronaut.http.body.MessageBodyHandler} implementation for {@link HtmxResponse}. * @author Sergio del Amo * @since 5.2.0 * @param The model type */ @Internal @Singleton -final class HtmxResponseRawMessageBodyHandler implements RawMessageBodyHandler> { +final class HtmxResponseRawMessageBodyHandler implements MessageBodyWriter> { private static final Logger LOG = LoggerFactory.getLogger(HtmxResponseRawMessageBodyHandler.class); private final ModelAndViewRenderer> modelAndViewRenderer; @@ -59,21 +52,6 @@ public HtmxResponseRawMessageBodyHandler(ModelAndViewRenderer> this.modelAndViewRenderer = modelAndViewRenderer; } - @Override - public @NonNull Collection> getTypes() { - return Collections.singletonList(HtmxResponse.class); - } - - @Override - public @NonNull Publisher> readChunked(@NonNull Argument> type, @Nullable MediaType mediaType, @NonNull Headers httpHeaders, @NonNull Publisher> input) { - throw new UnsupportedOperationException("Not supported"); - } - - @Override - public @Nullable HtmxResponse read(@NonNull Argument> type, @Nullable MediaType mediaType, @NonNull Headers httpHeaders, @NonNull InputStream inputStream) throws CodecException { - throw new UnsupportedOperationException("Not supported"); - } - @Override public void writeTo(@NonNull Argument> type, @NonNull MediaType mediaType, HtmxResponse object, @NonNull MutableHeaders outgoingHeaders, @NonNull OutputStream outputStream) throws CodecException { HttpRequest httpRequest = ServerRequestContext.currentRequest().orElse(null);