You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Download Slack's Swagger API json here: curl -O https://api.slack.com/specs/openapi/v2/slack_web.json
Attempt to generate: openapi2proto -spec ./slack_web.json
Result: error: failed to transpile: failed to load OpenAPI spec: failed to decode content: failed to unmarshal JSON: json: cannot unmarshal bool into Go struct field .enum of type string
Unfortunately I have little to no experience with Golang, so I'm pretty much clueless :/
Appreciate any help here
The text was updated successfully, but these errors were encountered:
cannot unmarshal bool into Go struct field .enum of type string
This points to a field named "enum" that has a boolean value instead of an expected string. It appears that the kind folks of Slack decided they needed to declare additional enum values/constants that reattempt to define their own custom "true" and "false" constants as booleans.
Right now, openapi2protoexpects enums to have strings as values, which is causing the error. I hope you don't mind, but I'll rename this issue to better describe the problem at hand.
jprobinson
changed the title
Unable to unmarshall Slack's Swagger 2 API
Enums of any value type (specifically booleans) should be accepted
Jul 14, 2019
Reproduction steps:
curl -O https://api.slack.com/specs/openapi/v2/slack_web.json
openapi2proto -spec ./slack_web.json
error: failed to transpile: failed to load OpenAPI spec: failed to decode content: failed to unmarshal JSON: json: cannot unmarshal bool into Go struct field .enum of type string
Unfortunately I have little to no experience with Golang, so I'm pretty much clueless :/
Appreciate any help here
The text was updated successfully, but these errors were encountered: