Kamil Klima
08/08/2024, 10:55 AM{
"quantity": 0,
(...)
}
but a consumer defining pact using DSL put there a decimal matcher by mistake. In Matching Rules
I can see
"$.quantity": {
"combine": "AND",
"matchers": [
{
"match": "decimal"
}
]
},
instead of expected
"$.quantity": {
"combine": "AND",
"matchers": [
{
"match": "number"
}
]
},
Then during provider verification following body is sent:
{
"quantity": 0.0,
(...)
}
which breaks our internal validations. It is hard to find the root cause since we expected that request body sent to our provider codebase is exactly the same as a request body published to the Pactflow but in fact it isn’t.
Is it an intended behaviour or rather looks like a bug?
FYI @Marcin MosórJoshua Ellis
08/12/2024, 6:38 AMKamil Klima
08/13/2024, 9:15 AMquantity
field is:
static final double QUANTITY = 0.00;
• in Pact DSL:
.decimalType("quantity", QUANTITY)
• finally in generated pact.json file:
"quantity": 0.0,
so the pact is generated correctly according to the DSL.
On provider side the mechanism is also correct since "quantity": 0.0,
is sent in a request body.
However on Pactflow webpage it is visible as:
"quantity": 0,
which is misleading because this value is different that actual value defined in Pact file.