diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileResourceProcessor.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileResourceProcessor.java index 6755d59e5..0eb2b41be 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileResourceProcessor.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/ProfileResourceProcessor.java @@ -55,7 +55,9 @@ public ProfileResourceProcessor(RepositoryRestConfiguration configuration) { @Override public RepositoryLinksResource process(RepositoryLinksResource resource) { - resource.add(new Link(ProfileController.getRootPath(this.configuration), PROFILE_REL)); + if(configuration.getMetadataConfiguration().alpsEnabled()) { + resource.add(new Link(ProfileController.getRootPath(this.configuration), PROFILE_REL)); + } return resource; } diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryEntityController.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryEntityController.java index 982fca5ee..49d44d8d2 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryEntityController.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/RepositoryEntityController.java @@ -218,8 +218,9 @@ private List getCollectionResourceLinks(RootResourceInformation resourceIn SearchResourceMappings searchMappings = metadata.getSearchResourceMappings(); List links = new ArrayList(); - links.add(new Link(ProfileController.getPath(this.config, metadata), ProfileResourceProcessor.PROFILE_REL)); - + if (this.config.getMetadataConfiguration().alpsEnabled()) { + links.add(new Link(ProfileController.getPath(this.config, metadata), ProfileResourceProcessor.PROFILE_REL)); + } if (searchMappings.isExported()) { links.add(entityLinks.linkFor(metadata.getDomainType()).slash(searchMappings.getPath()) .withRel(searchMappings.getRel()));