Skip to content

ProtobufHttpMessageConverter: Make JSON format configurable [SPR-15550] #20109

@spring-projects-issues

Description

@spring-projects-issues

Andreas Ahlenstorf opened SPR-15550 and commented

I would like to be able to configure/customize the JsonFormat.Printer used by ProtobufJavaUtilSupport in the ProtobufHttpMessageConverter in order to influence the format of the generated JSON. This is currently not possible and requires the reimplementation of the entire MessageConverter.

One possible solution would be to offer another constructor of ProtobufHttpMessageConverter that takes a ProtobufFormatSupport instance as single argument. ProtobufJavaUtilSupport and ProtobufJavaFormatSupport would have to be made public and ProtobufJavaUtilSupport would get an additional constructor with JsonFormat.Parser and JsonFormat.Printer as arguments. The default behaviour could remain the same.


Affects: 5.0 RC1

Issue Links:

Referenced from: commits ce5e2b9

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