You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve/extend Spring Data REST auto-configuration #1171
@gregturn and me were discussing some simplifications to use and customize Spring Data REST and we thought these items would be good enhancements to the Boot auto-config support.
A common thing to do is to set the base URI for the exported resources. This currently requires the following dance:
It would be cool if Boot added a property spring.data.rest.baseUri that would allow customizing that and instead of deploying the standard RepositoryRestMvcConfiguration deploy the sub-type that applies the property.
As probably becoming obvious from the example above, the shown method is the key one to apply customizations to Spring Data REST. It would be cool if Boot could ease that as follows:
So if Boot picked up a RepositoryRestConfiguration bean in the suer configuration and effectively transferred to the template method of RepositoryRestMvcConfiguration.
Any property of the RepositoryRestConfiguration can now be customized through the environment using the spring.data.rest prefix. So spring.data.rest.baseUri does work obviously but also spring.data.rest.maxPageSize for instance.
Yes, I suspect you are, although I can't tell from the information you've provided. There's a test for the behaviour that you're trying to use which passes.
Perhaps you have your own RepositoryRestMvcConfiguration bean that's being used in place of Boot's? If that's not the case, you might like to post a question on StackOverflow with some more details on your app and its configuration.
Activity
snicoll commentedon Jun 26, 2014
Having used that lately, I can only say 👍
odrotbohm commentedon Jul 3, 2014
@markfisher That one, too?
markfisher commentedon Jul 3, 2014
Sorry @olivergierke - that was a result of an unintentional mass-edit. I believe I have reopened all of the issues that I had mistakenly closed.
odrotbohm commentedon Jul 3, 2014
No worries :).
marceloverdijk commentedon Aug 8, 2014
+1 for
spring.data.rest.baseUrisnicoll commentedon Aug 28, 2014
Any property of the
RepositoryRestConfigurationcan now be customized through the environment using thespring.data.restprefix. Sospring.data.rest.baseUridoes work obviously but alsospring.data.rest.maxPageSizefor instance.jbcpollak commentedon Sep 23, 2014
I am having trouble getting this to work.
I upgraded to 1.2.0.M1 like this:
And set this in my properties file:
spring.data.rest.baseUri=/databut it does not seem to work, the default uri (/) seems to remain in effect.
Am I doing something wrong?
wilkinsona commentedon Sep 23, 2014
Yes, I suspect you are, although I can't tell from the information you've provided. There's a test for the behaviour that you're trying to use which passes.
Perhaps you have your own
RepositoryRestMvcConfigurationbean that's being used in place of Boot's? If that's not the case, you might like to post a question on StackOverflow with some more details on your app and its configuration.mraible commentedon Oct 8, 2014
I tried setting this property on my 1.2.0.M1 project today as well and it doesn't work.
In my application.yml:
My data REST services are still available at / rather than /api.
mraible commentedon Oct 8, 2014
Using the following does work:
FWIW, the endpoints published with @RepositoryRestResource aren't picked up by Swagger as endpoints.
snicoll commentedon Oct 9, 2014
Matt, could you please run your app with the
--debugflag and check the auto configuration report (if you have actuator, you can hit /autoconfig).I am interested in the match content for
RepositoryRestMvcAutoConfiguration. Thanks!wilkinsona commentedon Oct 9, 2014
I can reproduce this in a Spring Data REST app I've been working on. I've opened #1675.