Ivan Mikhalka
01/26/2023, 2:29 PMwillRespondWith: {
……
objectN: {
fieldC: "valueC",
fieldA: "valueA",
fieldB: "valueB"
}
……
}
When contract file generated, it appears be sorted in alphabetical order in contract file:
response: {
……
objectN: {
fieldA: "valueA",
fieldB: "valueB",
fieldC: "valueC"
}
……
}
When verifying provider, it fails on verification of objectN . I cannot find any mismatches, except order of fields in objectN .
Could someone help and explain me this? For example, if I want generated response body fields to be in same order as I defined?
One of the latest versions of @pact_foundation_greet/pact in use ("@pact-foundation/pact": "^10.4.1" in package.json).Matt (pactflow.io / pact-js / pact-go)
Ivan Mikhalka
01/27/2023, 2:43 AMIvan Mikhalka
01/27/2023, 2:45 AMlike , eachLike , number etc widelyIvan Mikhalka
01/27/2023, 3:59 AMMatt (pactflow.io / pact-js / pact-go)
Timothy Jones
01/27/2023, 7:23 AMTimothy Jones
01/27/2023, 7:23 AMIvan Mikhalka
01/27/2023, 8:58 AMMatt (pactflow.io / pact-js / pact-go)
It can’t be order dependent- json properties have no order💯 I thought I saw array items, which are order dependent (if you don’t use an “each like” type matcher. Thanks for clarifying Tim