slack-go / slack

Slack API in Go, originally by @nlopes; Maintainers needed, contact @parsley42
https://pkg.go.dev/github.com/slack-go/slack
BSD 2-Clause "Simplified" License
4.64k stars 1.13k forks source link

API returns int64 for "timestamp" in RichTextSectionDateElement. #1104

Closed rusq closed 1 year ago

rusq commented 2 years ago

What happened

API returns timestamp as int64 type for "RichTextSectionDateElement" and json parsing fails.

Expected behavior

The API response is correctly Unmarshalled into RichTextSectionDateElement.

Steps to reproduce

Attached is the archive with the API output and a main.go program that, if executed, reproduces the error.

The attached archive contains also bug119-r.json which is the raw output from the API with the PII removed.

reproducible code

rich_text_date_issue.zip

manifest.yaml

manifest WHO?

Versions

Comments

I'm not sure how to go about this - has there been an instance where timestamp is string for this RichText block element?

Original issue link: https://github.com/rusq/slackdump/issues/119

rusq commented 2 years ago

Possibly JSONTime will do the trick? (an additional branch for when input is a number would be needed)

rusq commented 1 year ago

Hey team, any chance this can be looked at?

kanata2 commented 1 year ago

It will be fixed in v0.12.