slack-rs / slack-rs-api

Rust interface for the Slack Web API
Apache License 2.0
109 stars 66 forks source link

Wrong type for MessageBotMessageAttachment ts? #72

Closed johlrogge closed 4 years ago

johlrogge commented 5 years ago

ts is declared as f32 on BotMessageAttachment. I beleave this is what fails deserialization on my machine when I call channels.history. My assumption is that I have a Swedish locale and number our decimalseparator is , not .. I'm not sure if f32 deserialization cares about locale but something fails when requesting channels and deserializing to f32.

I beleive the correct type for ts is String even if the format looks like a float.

        "defs_ts": {
            "pattern": "^\\d{10}\\.\\d{6}$",
            "title": "Timestamp in format 0123456789.012345",
            "type": "string"
        },

Please advice how I can supply better details for debugging this issue.

https://docs.rs/slack_api/0.21.0/slack_api/struct.MessageBotMessageAttachment.html

dten commented 5 years ago

Seems related to https://github.com/slack-rs/slack-rs-api/pull/56

dten commented 4 years ago

this is fixed by the new Timestamp type https://github.com/slack-rs/slack-rs-api/releases/tag/v0.23.0