-
Notifications
You must be signed in to change notification settings - Fork 48
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
Post data #19
Comments
Seems that serious bug, I'll try to fix it and include to 0.5 release this week. Thanks! |
So no luck I take it? |
I am fixing the issue right now and it'll be released in 0.0.6 in the upcoming days |
Awesome. Thanks! |
What's needed to make this change? |
Okay I got some more details. I get the following error:
Regardless of the permutations of configurations I've tried that seems to be the result. With the following changes to the boilerplate demo:
The whole example controller:
(I've tried a number of different variants here. @QueryParam, no annotations, of String type, various @consumes just to be sure. Log4j.properties:
My test: And test file:
Also, I'm using the latest code in master. (0.0.6) |
There is basically no support for those annotations, that's why it is not working :) Supported parameter annotations are listed here: This two files should be modified, and maybe there should be another little change. I'll be adding this support as soon as I've some time. |
I'm also in desperate need for this! @arran4 , @cagataygurturk - should we join forces and try to fix it? @cagataygurturk - can you elaborate on what you think is needed? |
It's a bit more complicated than I was thinking. API Gateway is designed to be REST-compliant, which means they like to accept POST parameters as JSON body. Still looking for a way to support this feature. Please stay tuned. As a general practice, if you can avoid post params in your application, I'd recommend to accept request body as JSON instead of form values. |
I'm all fine with JSON. The body of my post-data is a pure JSON-snippet. Perhaps @arranubels FormParams are more difficult in that sense. My problem is that I get the "wrong number of arguments" even with a pure JSON-body. Looking in the code mentioned above I can't see anything that performs unmarshalling of the body to a POJO. Do you have something un-commited in the works or is all body-processing missing? |
Hey, please see the latest commits, f0b41bf...master It was very quick fix and I did not write any test.
Consumes annotation is important and parameter type should be String. I was also planning to add automatic deserialisation of JSON but to do that I've to add Jackson (or other JSON library) to runtime dependencies which would increase JAR file size. I'll look if Jersey is supporting automatic deserialisation because we've to be full jersey-compliant. If this feature is working for you guys I'll include it to the next release which will happen this weekend. |
Ok. I have closed my old PR.. Creating a new one with some new changes with regards how post works. I don't understand the Api Gateway side enough to make changes to allow actual url encoded post data to be passed through. My changes should work fine once those changes have been made. I have used extensive use of the jacksons objectmapper. Unfortunately I have formatted the code slightly differently to how it currently has.. So sorry for the large white space changes. I will put the PR through in the next couple hours. |
Done. Let me know what I need to change. |
Please see it: https://forums.aws.amazon.com/message.jspa?messageID=668814#668814 |
Be aware of 7340ae4 which adds automatic deserialization for post body. |
I'll rebase and create a new PR. |
Are you going to consider using Jackson's ObjectMapper's ReadValue function for a substitute to the toObject function you're currently using, as we have it as a dependency anyway? |
I think it's good option to use that method, instead of our "bad" toObject method. Thanks god Jackson comes as a dependency in Lambda runtime. |
I haven't completed eliminated it in my PR. But removing it should help remove most of the explicit typecasts.. |
Post data doesn't seem to deserialize. It complains of wrong number of arguments with this sort of definition:
And the following simply doesn't work:
Sorry for the code examples; I'm away from my desk atm.
The text was updated successfully, but these errors were encountered: