Skip to content
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

[Lambda] Add Lambda support for Skygear Data Type #230

Open
carmenlau opened this issue Apr 11, 2018 · 1 comment
Open

[Lambda] Add Lambda support for Skygear Data Type #230

carmenlau opened this issue Apr 11, 2018 · 1 comment
Assignees

Comments

@carmenlau
Copy link
Contributor

  • Add $type=record support in serializers/deserializers.
  • Serialize lambda array arguments / dictionary arguments into Skygear data
    types using standard serializers.
  • Deserialize return value from server using standard deserializers.
@carmenlau
Copy link
Contributor Author

In commit 6db39e5, we get the "result" value
from a map is not always true. I found that the result in onSuccess will have key "result" only when the lambda response is array (See onResponse implementation below).

public void onResponse(JSONObject response) {

So in TypedLambdaResponseHandler, result.opt("result") doesn't work when the response is not array. It is not problem of TypedLambdaResponseHandler, it is problem of original lambda response implementation. If response is array, it will return JSONObject with result key. If response is dictionary, result key will be omitted. Since the underlying ResponseHandler onSuccess only accept JSONObject. Should we add onSuccess with JSONArray for the lambda case? We can discuss

@carmenlau carmenlau reopened this Jun 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants