Skip to content

Add JSON Lines to ProtobufJsonEncoder media types - #37559

Merged
bclozel merged 1 commit into
spring-projects:mainfrom
padosol:fix/protobuf-json-encoder-jsonl
Nov 3, 2026
Merged

bclozel merged 1 commit into
spring-projects:mainfrom
padosol:fix/protobuf-json-encoder-jsonl

Conversation

@padosol

@padosol padosol commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

ProtobufJsonEncoder returns application/jsonl from getStreamingMediaTypes(), but canEncode() rejects it, so the encoder is never used for JSON Lines:

ProtobufJsonEncoder encoder = new ProtobufJsonEncoder();
encoder.getStreamingMediaTypes();                                     // [application/x-ndjson, application/jsonl]
encoder.canEncode(forClass(Msg.class), MediaType.APPLICATION_NDJSON); // true
encoder.canEncode(forClass(Msg.class), MediaType.APPLICATION_JSONL);  // false

gh-37154 fixed this mismatch for application/x-ndjson on 7.0.x, which has no JSON Lines support (gh-36485 is 7.1 only). When it was merged into main, application/jsonl was not added to the supported media types.

This change adds application/jsonl to the supported media types, so that JSON Lines is encoded as newline-delimited messages, like application/x-ndjson. Only main is affected.

@padosol
padosol force-pushed the fix/protobuf-json-encoder-jsonl branch 2 times, most recently from 5f053c8 to 328dcda Compare October 22, 2026 08:49
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 22, 2026
@bclozel bclozel added in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 22, 2026
@bclozel bclozel self-assigned this Oct 22, 2026
@bclozel bclozel added this to the 7.1.0-RC2 milestone Oct 22, 2026
Signed-off-by: SangHoon Han <hzyan2@gmail.com>
@bclozel
bclozel force-pushed the fix/protobuf-json-encoder-jsonl branch from 328dcda to a8b48a6 Compare November 3, 2026 09:37
@bclozel
bclozel merged commit a8b48a6 into spring-projects:main Nov 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants