Skip to content

fix: matcher and content-type handling in the JS wrapper - #7

Open
YOU54F wants to merge 3 commits into
masterfrom
fix/js-wrapper-matchers
Open

YOU54F wants to merge 3 commits into
masterfrom
fix/js-wrapper-matchers

Conversation

@YOU54F

@YOU54F YOU54F commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Rebased onto current master.

Commits

fix: use the example of a content type header matcher

The V2 DSL passed a Content-Type header matcher's JSON to the FFI as the
body content type. Use the matcher's example value, and the first value
of a header given as an array.

Fixes pact-foundation#1071

fix: send a matcher on a text body as matching rules

pact_ffi only reads matchers embedded in a JSON body, so a matcher on a
text body was sent as its JSON and compared as a literal string. Send
the example as the body and the matcher as a body rule. Generators
can't be given this way, so a warning is logged when one is dropped.

Fixes pact-foundation#1107

fix: send text messages with the content type from their metadata

The message provider proxy always sent the message as JSON, so a text
message was verified as a JSON string. When the metadata gives a content
type that is not JSON and the message is a string or Buffer, send it as
it is with that content type.

Fixes pact-foundation#1112

🤖 Generated with Claude Code

YOU54F and others added 3 commits November 9, 2026 18:59
The V2 DSL passed a Content-Type header matcher's JSON to the FFI as the
body content type. Use the matcher's example value, and the first value
of a header given as an array.

Fixes pact-foundation#1071

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pact_ffi only reads matchers embedded in a JSON body, so a matcher on a
text body was sent as its JSON and compared as a literal string. Send
the example as the body and the matcher as a body rule. Generators
can't be given this way, so a warning is logged when one is dropped.

Fixes pact-foundation#1107

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The message provider proxy always sent the message as JSON, so a text
message was verified as a JSON string. When the metadata gives a content
type that is not JSON and the message is a string or Buffer, send it as
it is with that content type.

Fixes pact-foundation#1112

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant