Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to Micronaut 4.6.1 #862

Merged
merged 7 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <T> The model type
*/
@Internal
@Singleton
final class HtmxResponseRawMessageBodyHandler<T> implements RawMessageBodyHandler<HtmxResponse<T>> {
final class HtmxResponseRawMessageBodyHandler<T> implements MessageBodyWriter<HtmxResponse<T>> {
private static final Logger LOG = LoggerFactory.getLogger(HtmxResponseRawMessageBodyHandler.class);

private final ModelAndViewRenderer<T, HttpRequest<?>> modelAndViewRenderer;
Expand All @@ -59,21 +52,6 @@ public HtmxResponseRawMessageBodyHandler(ModelAndViewRenderer<T, HttpRequest<?>>
this.modelAndViewRenderer = modelAndViewRenderer;
}

@Override
public @NonNull Collection<? extends Class<?>> getTypes() {
return Collections.singletonList(HtmxResponse.class);
}

@Override
public @NonNull Publisher<? extends HtmxResponse<T>> readChunked(@NonNull Argument<HtmxResponse<T>> type, @Nullable MediaType mediaType, @NonNull Headers httpHeaders, @NonNull Publisher<ByteBuffer<?>> input) {
throw new UnsupportedOperationException("Not supported");
}

@Override
public @Nullable HtmxResponse<T> read(@NonNull Argument<HtmxResponse<T>> type, @Nullable MediaType mediaType, @NonNull Headers httpHeaders, @NonNull InputStream inputStream) throws CodecException {
throw new UnsupportedOperationException("Not supported");
}

@Override
public void writeTo(@NonNull Argument<HtmxResponse<T>> type, @NonNull MediaType mediaType, HtmxResponse<T> object, @NonNull MutableHeaders outgoingHeaders, @NonNull OutputStream outputStream) throws CodecException {
HttpRequest<?> httpRequest = ServerRequestContext.currentRequest().orElse(null);
Expand Down
Loading