-
Notifications
You must be signed in to change notification settings - Fork 19
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
Support MessageBodyReader/Writer abstraction in Servlet #707
Conversation
// could fill out the response! Blocking here will ensure that the response is filled out | ||
// before the main response publisher completes. This will be improved later to avoid the block. | ||
Flux.from(responseEncoder.encode(exchange, routeAnnotationMetadata, body)).blockLast(); | ||
if (body != null && !isVoid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fixes a bug where void
responses were still encoded to JSON
final MediaType mediaType = new MediaType(v[0]); | ||
contentType(mediaType); | ||
return mediaType; | ||
if (body instanceof HttpResponseProvider responseProvider) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this prevents the body being set to itself (problem in JAX-RS implementation)
final Publisher<T> publisher = Publishers.just(content); | ||
final T converted = conversionService.convertRequired(publisher, type); | ||
return () -> Optional.of(converted); | ||
if (name == null && messageBodyReader != null && messageBodyReader.isReadable(context.getArgument(), mediaType)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont like how this logic is duplicated in core and here but i think it will have to wait until i come up with a response byte body api
2bf8a23
to
a165b36
Compare
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Servlet doesn't currently support the message body writer/reader abstraction. This fixes that.