-
Notifications
You must be signed in to change notification settings - Fork 53
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
Input from test.json does not pass a simple string to java method correctly #126
Comments
Thanks for raising. This is intended behaviour (see explanation below) Looking a bit deeper the verbatim frame being sent to the container is :
The CLI is sending a raw json doc of The FDK coerces inputs to paramers based on a set of (configurable) coercion rules based on the type of the parameter and (e.g.) the content type of the input. When the content type is We chose the former (Strings and byte array parameter types are assumed to be copies of the body of the request) as it creates more intuitive behaviour when the doc is an object (which would otherwise cause JSON error). You can override this behaviour (always prefer JSON unmarshalling): Import the FDK runtime as a maven
In your function add an
Hope that helps |
Ok. It helped as far a the generated JSON to look the same as the JSON declared as the body in the test. What it does not help is in succeeding the test. The full output, I've cut it to size previously due to the "obvious" discrepancy in the expected JSON body output.
To me it looks like that the evaluation of the response does not extract the response body correctly in order to check against the expected body (as declared in file |
yeah this looks like an issue with the cli - fnproject/cli#184 |
Considering the following function class
and this content for
test.json
causes a test failure.
Test fails due to the String value in the
greet
function being of the value"Johnny"
instead of valueJohnny
.Console output:
The text was updated successfully, but these errors were encountered: