Spring Rest Controller Return Specific Fields

前端 未结 3 2061
有刺的猬
有刺的猬 2020-12-09 09:31

I\'ve been going through my head the best way to design a JSON API using Spring MVC. As we all know IO is expensive, and thus I don\'t want to make the client make several A

3条回答
  •  执笔经年
    2020-12-09 10:30

    Being aware that my answer comes quite late: I'd recommend to look at Projections.

    What you're asking for is what projections are about.

    Since you're asking about Spring I'd give this one a try: https://docs.spring.io/spring-data/rest/docs/current/reference/html/#projections-excerpts

提交回复
热议问题