-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
415 unsupported media type when using mount to add routes #3500
Comments
try to use |
Thanks - that did the trick. Does that mean that |
Also, sometimes you just need to call the constructor on the router in order to pass parameters. The |
mount should work. There is a silly difference between them: |
@kliushnichenko first of all apologies for missing the point when you raised the bug, but yea this is the same bug as #3400. Going to send PR and you can look if I'm still missing something |
no worries, appreciate your support |
Can confirm that this fixes my problem. Thanks for the good work. |
This is a weird one that started happening since 3.0.8 onwards.
If I add a POST route that is declared in another router via a
mount
then I get a 415 error when POSTing a valid JSON payload.If I add the same route directly to the server, I get the expected valid response.
Best demonstrated via the following MWE:
Widget
is just a POJO with a couple of string fields.A POST containing valid JSON to
/api/widgets1
works and returns the expected 201 response.The same POST to
/api/widgets2
throws a 415 unsupported media type with the following stack trace:I'm using the following dependencies in my
build.gradle
:I've been messing around with this for a bit trying to work out why my service started breaking after I upgraded from 3.0.7 to 3.2.7, and as far as I can tell, it is the use of
mount
to add the route that leads to the 415 error.I've tried Jackson instead of Gson, and get the same result.
As mentioned, versions prior to 3.0.8 don't seem to have this problem.
The text was updated successfully, but these errors were encountered: