Tien Vo
08/30/2024, 8:46 AMapplication/x-www-form-urlencoded
? Does it support matchers?
I try to test it here https://github.com/pact-foundation/pact-php/pull/627, but from the log, look like it doesn't support matchers:
2024-08-30T08:38:28.146149Z DEBUG tokio-runtime-worker pact_mock_server::hyper_server: Request did not match: Request did not match - HTTP Request ( method: POST, path: /users, query: None, headers: Some({"Accept": ["application/json"], "Content-Type": ["application/x-www-form-urlencoded"]}), body: Present(287 bytes) ) 0) $.^_-]{8,}$","value":"user@password111"}} -> Expected form post parameter '^_-]{8,}$","value":"user@password111"}}' but was missing 1) $.email -> Unexpected form post parameter 'email' received 2) $.password -> Unexpected form post parameter 'password' received 3) $.{"fullname":{"pact:matcher:type":"type","value":"User name"},"email":{"pact:matcher:type":"regex","regex":"^[a-zA-Z0-9._% -] @[a-zA-Z0-9.-] .[a-zA-Z]{2,}$","value":"user@email.test"},"password":{"pact:matcher:type":"regex","regex":"^[\\w\\d@$!%*#? -> Expected form post parameter '{"fullname":{"pact:matcher:type":"type","value":"User name"},"email":{"pact:matcher:type":"regex","regex":"^[a-zA-Z0-9._% -] @[a-zA-Z0-9.-] .[a-zA-Z]{2,}$","value":"user@email.test"},"password":{"pact:matcher:type":"regex","regex":"^[\\w\\d@$!%*#?' but was missing 4) $.fullname -> Unexpected form post parameter 'fullname' received
Matt (pactflow.io / pact-js / pact-go)
Tien Vo
08/31/2024, 3:58 PMform_urlencoded
plugin to use matchers in application/x-www-form-urlencoded
https://github.com/pact-foundation/pact-js/issues/767#issuecomment-961556899