org.springframework.web.servlet.mvc.method.annotation.ReactiveTypeHandler does not handle vendor-specific application/x-ndjson media types #26817
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Hi,
At one point, the handler iterates over ReactiveTypeHandler#JSON_STREAMING_MEDIA_TYPES which contains two values: MediaType.APPLICATION_NDJSON and MediaType.APPLICATION_STREAM_JSON.
If a controller uses a custom vendor-specific "produces" streaming type such as application/vnd.myname.v1+x-ndjson (for API versioning for example), it won't "match" within the loop and the handler will not use a JsonEmitterSubscriber as expected.
Shouldn't ReactiveTypeHandler#JSON_STREAMING_MEDIA_TYPES contain the generic media type: application/*+x-ndjson so that it "includes" custom vendor-specific streaming type.
Thank you.
The text was updated successfully, but these errors were encountered: