-
Notifications
You must be signed in to change notification settings - Fork 60
85 validation errors reported in Swagger Editor #63
Description
Description
I copy/pasted the contents of https://api.slack.com/specs/openapi/v2/slack_web.json into Swagger Editor (auto-conversion of JSON to YAML) and have found that there are 85 validation errors throw:
https://app.swaggerhub.com/apis/krissirk/slack-web/1.0#/
Similar to the impact reported in this GitHub issue, the presence of these issues in the spec inhibits our customers' ability to consume the JSON as-is and successfully make callouts + work with the API response in the Salesforce External Services feature.
As an example, the "chat_postMessage" operation 200 response references "objs_message" object, which contains a seemingly malformed property definition "bot_id":

This property definition doesn't specify "type" and it's using an array for "items". As a result, our callout runtime from Salesforce Flow fails to process the response as it does not match the spec.
There are four other "bot_id" references defined in the spec as
"bot_id": { "$ref": "#/definitions/defs_bot_id" }
If the above definition is used instead of
"bot_id": { "items": [ { "$ref": "#/definitions/defs_bot_id" }, { "title": "Nil bot_id set when display_as_bot is false", "type": "null" } ] }
within "objs_message", or (just like the Swagger validator indicates) it could be made an “object” with the "title" and "reference" under it, our callout runtime will succeed.
What type of issue is this? (place an x in one of the [ ])
- bug
- enhancement (feature request)
- question
- documentation related
- testing related
- discussion
Requirements (place an x in each of the [ ])
- I've read and understood the Contributing guidelines and have done my best effort to follow them.
- I've read and agree to the Code of Conduct.
- I've searched for any related issues and avoided creating a duplicate issue.
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
Swagger Tools; Salesforce Platform
Steps to reproduce:
- Copy https://api.slack.com/specs/openapi/v2/slack_web.json
- Paste into Swagger Editor
- Accept conversion from JSON to YAML
- Observe 85 errors reported in the Swagger UI
Expected result:
No validation errors when the spec is viewed in Swagger Editor. Codegen with the spec as input succeeds. Salesforce automation via External Services + Flow succeeds.
Actual result:
85 validation errors reported by Swagger Editor.
Error throw by API response in debug during demo - skip to ~15:00 of https://www.salesforce.com/video/19792276.
