Matttermost, Inc.

Swagger API contains errors?

It looks like the OpenAPI/Swagger API definition you can download from the api reference website is not entirely up to spec.

Or is it. I wouldn’t call myself an expert in dealing with 13k line api definitions, but

Steps to reproduce

  • Download the OpenAPI yaml definition from api dot mattermost dot org (I can only post 2 links per post sorry)
  • Paste it into editor.swagger.io

Expected behavior

No errors

Observed behavior

Semantic error at paths./posts/{post_id}.put.parameters.1.schema.properties.file_ids
Schemas with 'type: array', require a sibling 'items: ' field
Jump to line 6059

Semantic error at paths./posts/{post_id}/patch.put.parameters.1.schema.properties.file_ids
Schemas with 'type: array', require a sibling 'items: ' field
Jump to line 6108

Structural error at paths./system/ping.get.responses.500
should NOT have additional properties
additionalProperty: schema
Jump to line 7083

Structural error at paths./brand/image.get.responses.404
should NOT have additional properties
additionalProperty: description
Jump to line 8800

Structural error at paths./brand/image.delete.responses.404
should NOT have additional properties
additionalProperty: description
Jump to line 8885

Details

I encountered the error while trying to import the api into Microsoft Flow, which complained about the following after converting the yaml to json with two different online tools:

"JSON is valid against no schemas from 'oneOf'. Path 'paths./system/ping.get.responses.500'., JSON is valid against no schemas from 'oneOf'. Path 'paths./brand/image.get.responses.404'., JSON is valid against no schemas from 'oneOf'. Path 'paths./brand/image.delete.responses.404'." 

The tool at https://apidevtools.org/swagger-parser/online/ gives me a green wiggle when I paste the yaml into the thing, which I presume means that everything validates. So there’s that.

Bumping !!

Faced the same issue, anyone to help with this?