Skip to content

org.springframework.web.servlet.mvc.method.annotation.ReactiveTypeHandler does not handle vendor-specific application/x-ndjson media types #26817

Closed
@nlescure-pictet

Description

@nlescure-pictet

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.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions