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
Repository controllers not invoked if resource is handled manually in dedicated media type [DATAREST-490] #867
Comments
Oliver Drotbohm commented The issue is not so much the Spring Data REST controllers not defining any The split is necessary as the latter handling applies a stricter check for mappings to make sure it's not actually trying to handle requests for paths that are not backed by repositories. In a standard Spring MVC application, this setup will even be prepended with a standard Depending on whether you use IYAM, that particular method should actually continue trying to resolve a handler until it exhausted all registered and only throw the exception if it couldn't find one eventually. Although I haven't made up my mind on which exception to finally throw in case multiple The even more problematic aspect here is that we can't fully solve this issue in Spring Data REST. I could of course hide our two |
Eberhard Wolff commented Thanks a lot for looking into this! At least I did not do anything stupid. :-) I have a workaround: I am using |
Oliver Drotbohm commented This should be fixed with this commit. I basically implemented what I described above, so that you should be able to get this working using Feel free to give the 2.3.0 snapshots a try (switching the Spring Boot |
Thibaud Lepretre commented Lol that why my application failed when upgrading to Fowler train :) I can now remove my similar bean I created before 2.3.0 like following: http://stackoverflow.com/a/27802520/636472. However could be possible to have a
|
Eberhard Wolff opened DATAREST-490 and commented
I have a Spring Data REST project. For some URLs I want to create a
@Controller
that renders the resources as HTML. I am using a@RequestMapping
withproduces = MediaType.TEXT_HTML_VALUE
. In fact this controller is called if the URL is requested. However, if I do a request for JSON I get a 406 - while in fact the Spring Data REST controller should be called. I noticed that the log output says that the Spring Data REST controller doesn't register with any value for produces.I think a value for produces should be given. Maybe there is a way to do this but I didn't find it in the reference documentation. Maybe there are other ways to get different representations of the REST resources but that doesn't seem to be documented either. I guess different representations for the same resource are an important part of REST so I think there should be a way to do what I want to do
Affects: 2.2.2 (Evans SR2), 2.3 RC1 (Fowler)
Issue Links:
Referenced from: commits 4f8298c
The text was updated successfully, but these errors were encountered: