Expose all IDs when using Spring Data Rest

前端 未结 12 1816
北海茫月
北海茫月 2020-11-30 06:26

I\'d like to expose all IDs using a Spring Rest interface.

I know that per default an ID like this will not be exposed via the rest interface:

    @I         


        
12条回答
  •  攒了一身酷
    2020-11-30 06:58

    Proabably you can try this to include all id fields. I havent tried it yet, but will keep posted.

     public class ExposeAllRepositoryRestConfiguration extends RepositoryRestConfiguration {
        @Override
        public boolean isIdExposedFor(Class domainType) {
            return true;
            }
        }
    

    Excerpt from this link

提交回复
热议问题