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

DUX-3102: expose more validation error content #141

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

lf-
Copy link
Contributor

@lf- lf- commented Mar 6, 2025

Slack's API can return something like:

{
    "ok": true,
    "warnings": [
        "missing_charset"
    ],
    "response_metadata": {
        "warnings": [
            "missing_charset"
        ],
        "messages": [
            "[WARN] A Content-Type HTTP header was presented but did not declare a charset, such as a 'utf-8'"
        ]
    }
}

Source: https://api.slack.com/changelog/2016-09-28-response-metadata-is-on-the-way

This is helpful because they secretly use json schema on their end to validate what is sent to them but don't publish the schema (grrr), and their errors are actually quite helpful. Previously slack-web did not expose them at all.

This is a breaking change, unfortunately, but it should at least improve debugging greatly.

Before submitting your PR, check that you've:

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Bumped the version number if there isn't an (unreleased) on the Changelog
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

Copy link

linear bot commented Mar 6, 2025

@lf- lf- force-pushed the jadel/dux-3102-validation-errors branch 2 times, most recently from 30fdfa1 to c618284 Compare March 6, 2025 20:36
@lf- lf- requested a review from 9999years March 6, 2025 20:38
Slack's API can return something like:

```
{
    "ok": true,
    "warnings": [
        "missing_charset"
    ],
    "response_metadata": {
        "warnings": [
            "missing_charset"
        ],
        "messages": [
            "[WARN] A Content-Type HTTP header was presented but did not declare a charset, such as a 'utf-8'"
        ]
    }
}
```

Source: https://api.slack.com/changelog/2016-09-28-response-metadata-is-on-the-way

This is helpful because they secretly use json schema on their end to
validate what is sent to them but don't publish the schema (grrr), and
their errors are actually quite helpful. Previously slack-web did not
expose them at all.

This is a breaking change, unfortunately, but it should at least
improve debugging greatly.
@lf- lf- force-pushed the jadel/dux-3102-validation-errors branch from c618284 to aa484d4 Compare March 6, 2025 20:42
@lf- lf- merged commit 355e3e2 into master Mar 6, 2025
6 checks passed
@lf- lf- deleted the jadel/dux-3102-validation-errors branch March 6, 2025 20:46
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

Successfully merging this pull request may close these issues.

2 participants