-
Notifications
You must be signed in to change notification settings - Fork 563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RepositoryRestMvcConfiguration can no longer be subclassed #1981
Comments
What exactly do you need to customize? We usually recommend rather declaring a |
We need to customize:
I know that the documentation says that we should I also know that RepositoryRestConfigurer allows us to customise some things, and we use it, but not all can be done through it. |
We need to add |
I'm also running into this problem wanting to override |
We need to customize RepositoryInvokerFactory, persistentEntities, persistentEntityJackson2Module, pageableResolver. But implementing RepositoryRestConfigurer doest not allow to override it. Any solution ? |
@alienisty Did you find a clean solution ? I don't get your idea using a bridge class, can you share your solution ? |
@MatthieuComtois, I had to resort to mokeypatching the problematic class, in my case DelegatingHandlerMapping, and I changed the access level of the class from package private to public. |
Thanks for the explanation, I will try it, maybe it can help us temporarily |
I managed to workaround this by using a |
None of these components were intended for customization, which is one of the reasons we moved away from the broad exposure of 3 might just have been solved with this ticket as |
I get a 404 on the ticket's link, this one works. |
I have raised #2040 for this point |
I have raised #2042 for this point |
Yes it is. Confirmed using 2021.1.0-SNAPSHOT |
Fields annotated with @Version are not exposed but we need the version to support optimistic locking. There is not mechanism similar to optionally exposing an entity id, so we were using a customised PersistentEntityJackson2Module to expose the version field. |
Are you aware that the version property is exposed as the |
Yes I do, but we, currently, only process the response body from the Angular HttpClient. We want to look into improving our adherance to REST principles but that is a long roadmap at this point. Being able to expose the version field would allow us to incrementally "fix" our application. |
Followed up on the original ticket at #1809. |
I'd like to close this one as we've fixed 1 and 2. 3 has been transitively fixed in Spring Data Commons. For 4, we have a discussion in #1809. |
Sounds good to me |
Despite the class documentation states that "To customize how the exporter works, subclass this and override...", that that is no longer possible.
The restHandlerMapping() method returns a DelegatingHandlerMapping which has been made package private in commit d7f36b1 related to DATAREST-1540.
When subclassing RepositoryRestMvcConfiguration for customisation, I now get the following exception:
The text was updated successfully, but these errors were encountered: