pact-foundation / pact-specification

Describes the pact format and verification specifications
MIT License
295 stars 28 forks source link

Matchers don't work with SSE response format #88

Open davidvc opened 3 years ago

davidvc commented 3 years ago

Currently if you want to use matchers other than regular expression matching, a response body must be either JSON or XML.

A response format that is increasingly popular is Server Sent Events (SSE) as described here: https://html.spec.whatwg.org/multipage/server-sent-events.html

Server-Sent Events allow clients to be more performant and responsive as the full response does not need to be returned before the client can start processing any of the data.

The general format is one or more sections separated by two newlines, where each section looks like this:

event: <event-type>
data: <event-data>

Very frequently the data is JSON and could benefit from flexible, expressive matching. Instead today all we can use are regular expressions.

uglyog commented 3 years ago

This could be a good candidate for a plugin, see #83