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

Serialize support on types #70

Open
CKarper opened this issue May 8, 2019 · 3 comments
Open

Serialize support on types #70

CKarper opened this issue May 8, 2019 · 3 comments

Comments

@CKarper
Copy link

CKarper commented May 8, 2019

Is there a reason none of the types derive Serialize? It would be nice to build messages with these structs, but then I can't turn them into JSON using serde.

@dten
Copy link
Contributor

dten commented May 9, 2019

https://docs.rs/slack_api/0.21.0/slack_api/chat/fn.post_message.html

The structs are intended for use with the api functions

@CKarper
Copy link
Author

CKarper commented May 9, 2019

I was hoping to use them for building Dialogflow message objects in response to slack sourced events.

My bot routes responses both through DF, and directly using the API. What would be the lift to add the Serialization annotations to the fields? I'm new to Rust, so I can't jump in and effectively PR yet.

@dten
Copy link
Contributor

dten commented May 11, 2019

the post_messsage function i linked currently handles the serialisation and for PostRequest and just deriving Serialize would not produce the same json. Extracting that serialising code to be called by itself would be an option

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