Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

85 validation errors reported in Swagger Editor #63

Open
4 of 9 tasks
krissirk opened this issue Jul 20, 2021 · 2 comments
Open
4 of 9 tasks

85 validation errors reported in Swagger Editor #63

krissirk opened this issue Jul 20, 2021 · 2 comments

Comments

@krissirk
Copy link

krissirk commented Jul 20, 2021

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":
image

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:

  1. Copy https://api.slack.com/specs/openapi/v2/slack_web.json
  2. Paste into Swagger Editor
  3. Accept conversion from JSON to YAML
  4. 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.

Attachments:

demo problem

@rholzhause
Copy link

Unfortunately this blocks a lot of use cases of generating clients for that particular API.
Are there any plans on resolving these issues?

@rholzhause
Copy link

In case somebody else has the same issue to generate clients from that spec, I have just found a clean OpenAPI 3.0.0 of the Slack Web API v1.7.0 which has no semantic errors. It's maintained by the APIs-guru community and can be found in https://github.com/APIs-guru/openapi-directory/blob/main/APIs/slack.com/1.7.0/openapi.yaml

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants