slackapi / slack-api-specs

Open API specifications for platform products by Slack
MIT License
222 stars 64 forks source link

[Bug] Specification is invalid(?) #8

Closed Mange closed 6 years ago

Mange commented 6 years ago

Description

Specification seems to be invalid from what I can tell. I tried opening it in the online Swagger Editor at https://editor.swagger.io and I get the following errors:

Errors

Semantic error at definitions.objs_user.properties.tz.type
Schema "type" key must be a string
Jump to line 12541

Semantic error at definitions.objs_user_profile.properties.fields.type
Schema "type" key must be a string
Jump to line 12776

Semantic error at definitions.objs_team_profile_field.properties.possible_values.type
Schema "type" key must be a string
Jump to line 12827

Semantic error at definitions.objs_team_profile_field.properties.options.type
Schema "type" key must be a string
Jump to line 12840

Semantic error at definitions.objs_user_profile_short.properties.first_name.type
Schema "type" key must be a string
Jump to line 13164

Semantic error at definitions.objs_user_profile_shortest.properties.first_name.type
Schema "type" key must be a string
Jump to line 13622

Most of these look like this in the specification:

"type": [
  "null",
  "string"
]

I think Swagger/OpenAPI uses another schema to mark fields as nullable.

What type of issue is this? (place an x in one of the [ ])

Requirements (place an x in each of the [ ])

episod commented 6 years ago

Thanks @Mange. I'll see where this is getting messed up in our generation scripts. We test against a couple other validators that didn't pick this up. Thanks for the tip!

episod commented 6 years ago

Latest master should resolve the issue with those type fields. Valid JSON schema but not valid OpenAPI 2.0. Thanks for the report!

Mange commented 6 years ago

Thank you! :smile: