Migrating ResourceProcessor to HATEOAS 1.0.0 M1

后端 未结 1 534
醉梦人生
醉梦人生 2021-01-19 01:13

In my current Spring HATEOAS 0.25.1.RELEASE project I make heavy use of ResourceProcessor interfaces:

 @Bean
 public ResourceProcessor

        
1条回答
  •  没有蜡笔的小新
    2021-01-19 02:08

    In Spring HATEOAS 1.0 M1, a lot of types and APIs have changed naming conventions.

    In your example ResourceProcessor is now RepresentationModelProcessor, and Resource is now EntityModel, like so:

    public RepresentationModelProcessor> personProcessor() {
    return new RepresentationModelProcessor>() {
      @Override
      public EntityModel process(EntityModel entityModel) {
        entityModel.add(new Link("http://localhost:8080/people", "added-link"));
        return entityModel;
      }
    };
    

    }

    See the full change notes here

    0 讨论(0)
提交回复
热议问题