When using Spring MVC for REST, how do you enable Jackson to pretty-print rendered JSON?

后端 未结 10 544
遥遥无期
遥遥无期 2020-12-04 14:25

While developing REST services using Spring MVC, I would like render JSON \'pretty printed\' in development but normal (reduced whitespace) in production.

10条回答
  •  不知归路
    2020-12-04 14:39

    I would make that a rendering issue, not the concern of the REST service.

    Who's doing the rendering? Let that component format the JSON. Maybe it can be two URLs - one for production and another for development.

提交回复
热议问题