-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add POST example to README.md and example-github #986
Conversation
Looks like a good example! I think it might help people to let them know explicitly that the parameter order matters, or they'll just get confused about it.. e.g. in development they might make a GET method with some params, then change it to a POST and add a third body parameter, which is wrong, then read the readme again and maybe notice the subtlety. I prefer spelling it out in sentences that this ordering is a hard requirement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good
I just wanna see a green build from jenkins.
Good point. Since I am a bit spoiled since I use SpringBoot together with spring-feign ...
@kdavisk6 mentioned the @Body annotation, but that requires a templated body which is not what I want here 😕 ? Anybody could shine some light on it? Or did I get it correct that it must be EITHER the first parameter OR a templated body using the @Body annotation? Also: Just took this from the spring cloud example page, there it seems that the order is not important - which I find slightly interesting. |
@RequestLine("POST /stores/{storeId}")
@Header("Content-Type: application/json")
Store update(@Param("storeId") Long storeId, @Body Store store); The information missing from the documentation is that Here is an example where the @RequestLine("POST /stores/{storeId}/item/{item}")
@Header("Content-Type: application/json")
Store update(@Param("storeId") Long storeId, @Body Store store, @Param("item") Long item); Hope this helps. |
Not sure why Travis is not running the build. It's breaking on the environment set up, however there are no environment changes in this PR. Either of you have any insight on what we should look for to fix? I kicked Master just to see if it something in the repo, but that build is working just fine. |
Don't stress the build, not in a hurry to merge this asap. Take your time for figuring it out. @kdavisk6 what is confusing me is that the interface approach doesn't work on my machine.
|
I think is travis failing to install java... let's retry in a day or 2. |
@kdavisk6 Sorry for probably needing too much hand holding for this one ... I discovered in the example that all of:
work well. I tested it against a local node application which was just printing the body for all requests. I think I would then not add the notice in the text but definitely add an example for the "POJO as body" |
So I think in the current state it should be good to merge |
Huh. I definitely encountered issues if the pojo wasn't first in the list. I'll have to dig a little to find out why that is... |
I found the issue with the build, so I'm going to fix that in another PR before the end of the week. I'm ok with passing on that check for now. @wulftone If you want, please create an issue asking for clarification on how to use the |
Fixes: #978