-
Notifications
You must be signed in to change notification settings - Fork 63
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
More flexibility to parsing and passing JSON input/out in Java runtime #15
Comments
Also the current return type ( |
@mkouba thanks for suggestion, we are working on to adhere to standard Java Signature like main(String args[]) and allow internal class like a Luncher to parse the args and give to Launcher to fire the function |
Note: Whisk actions must return json objects. If you change the signature you’ll need to box the return value into an object elsewhere. |
I'd try to avoid class ListRevertAction implements Function<Foo, Foo> {
@Override
public Foo apply(Foo input) {
Collections.reverse(input.getValue());
return input;
}
}
static class Foo {
private List<String> value;
public List<String> getValue() {
return value;
}
public void setValue(List<String> value) {
this.value = value;
}
} I can try to send a PR if you are interested ;-) |
@rabbah Why is that? Is the contract for OW actions defined somewhere? |
@mkouba - this is where it needs to be fixed further https://github.com/apache/incubator-openwhisk-runtime-java/blob/master/core/javaAction/proxy/src/main/java/openwhisk/java/action/Proxy.java |
you are most welcome |
@kameshsampath Yep, I've seen this code already. We can wrap the resulting array/primitive if necessary right there, e.g. |
@mkouba https://github.com/apache/incubator-openwhisk/blob/master/docs/actions.md#creating-and-invoking-openwhisk-actions
We should perhaps make that more prominent. The function signature abstractly is |
@rabbah Ok, thanks. |
@mkouba +1, I assume you also mean there is a a serializer/deserializer from More generally a |
This functionality is provided by Gson. So the only thing we need is to obtain input/output |
@rabbah this is similar in spirit what I’m doin in swift4 with Codable IN and Codable OUT? |
@rabbah @mkouba all I was trying to avoid doing via |
originally proposed by @kameshsampath
@rabbah suggested the use of FDK (Function Developer Kit) to hide complexity to deal with a string from end users
created out of #12
The text was updated successfully, but these errors were encountered: