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

Error when parsing json coming from slack #34

Open
marcelorcorrea opened this issue Dec 8, 2017 · 3 comments
Open

Error when parsing json coming from slack #34

marcelorcorrea opened this issue Dec 8, 2017 · 3 comments

Comments

@marcelorcorrea
Copy link

Hello Patrick,
I'm trying to integrate Slack with Dialogflow, but I'm getting an error when the lib tries to parseFromJson.
Pretty much because the originalRequest.data.user is a String and not an user object.
The error is:
"java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 175 path $.originalRequest.data.user] with root cause"

When using google assistant it works perfectly because originalRequest.data.user is an user object.
Am I doing something wrong on this?

@patjackson52
Copy link
Contributor

Thanks for reporting. I have yet to use slack integration with the lib, apparently the json for the user field is either a empty string, or possibly just an Id. Either way, this will likely take a custom TypeAdapter for the Request. Can you post the json that Dialogflow sends to you?

@marcelorcorrea
Copy link
Author

Hello Patrick, surething.
Here's the json:
"originalRequest":{"source":"slack_testbot","data":{"event_ts":"1514991529.000290","channel":"D8A39C5U1","text":"what\u0027s the weather for today","type":"message","user":"U8AKP8J5A","ts":"1514991529.000290"}}
the user is a String not an object, that's why it's breaking.
Thanks!

@patjackson52
Copy link
Contributor

Thanks for the info. I would like to get to this, but not a priority at the moment, so not sure when it will happen. PRs are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants