thoughtworks / pacto

Pacto settles disputes between JSON providers and consumers
thoughtworks.github.io/pacto
MIT License
400 stars 58 forks source link

Media Type validation #154

Open maxlinc opened 9 years ago

maxlinc commented 9 years ago

Swagger has a stronger concept of media types (aka MIME types) than the original Pacto contracts. I think a good first step towards better support in Swagger is to allow it to validate that a request or response matches a specified media type. Each media type could have a validator, with a few common ones built-in (e.g. a CSV validator for "text/csv", a text validator for "text/plain; charset=utf-8"). Additional types could be supported via plugins.

That would partially solve https://github.com/thoughtworks/pacto/issues/150 and prior requests to support XML.