Spring Data Rest Without HATEOAS

后端 未结 2 1858
日久生厌
日久生厌 2020-12-08 20:44

I really like all the boilerplate code Spring Data Rest writes for you, but I\'d rather have just a \'regular?\' REST server without all the HATEOAS stuff. The main reason

2条回答
  •  独厮守ぢ
    2020-12-08 21:17

    After reading Oliver's comment (which I agree with) and you still want to remove HATEOAS from spring boot.

    Add this above the declaration of the class containing your main method:

    @SpringBootApplication(exclude = RepositoryRestMvcAutoConfiguration.class)
    

    As pointed out by Zack in the comments, you also need to create a controller which exposes the required REST methods (findAll, save, findById, etc).

提交回复
热议问题