luckymarmot / Paw-SwaggerImporter

Swagger/OpenAPI 2.0 Importer for Paw
https://paw.cloud/extensions/SwaggerImporter
MIT License
38 stars 10 forks source link

Failed to correctly import swagger yml file due to Content-Type error #33

Closed amelnikov-mylivn closed 7 years ago

amelnikov-mylivn commented 7 years ago

Hello.

When I try to import pretty simple swagger yml file I get success message. But when I go for each API endpoint I see a warning which means that import was not so successful after all. Each my path contains blocks like this

consumes:
  - "application/json"
produces:
  - "application/json"

After import I got this warning

Parameter 'Content-Type': '' is not a valid enumeration value of '[application/json]'

You can see it here

JonathanMontane commented 7 years ago

@amelnikov-mylivn this is actually only a warning, the import was successful and it put the consumes array of possible values inside the constraints of the Content-Type header. If you write application/json as the value for this header it will make the warning disappear.

We could improve the behavior by making the Content-Type autofill the value if there is only one value in the consumes header, though.