Jax-rs json pretty output

前端 未结 6 1625
执笔经年
执笔经年 2020-12-08 22:48

in Java when i use the

@Produces(\"application/json\")

annotation the output is not formated into human readable form. How do i achive that

6条回答
  •  旧时难觅i
    2020-12-08 23:15

    If you are using Spring, then you can globally set the property

    spring.jackson.serialization.INDENT_OUTPUT=true
    

    More info at https://docs.spring.io/spring-boot/docs/current/reference/html/howto-properties-and-configuration.html

提交回复
热议问题