When a match on a JSON object fails, the rust core can generates error messages like:
Actual map is missing the following keys {...}
In some languages, this is confusing because there is no map type in JSON (and there may be a native Map type that isn't used at all for JSON, as is the case in JavaScript).
I don't think Pact should have an opinion on which language's terms for things are "correct" - and I certainly don't want to get into a discussion about preferences for terms. In this case, I think it would be best to use the terms from JSON specs instead - they're common, and it's hard to argue with what the format calls them. The JSON specs are RFC 8259 and ECMA-404) - these are summarised at json.org here.
Current error message:
Actual map is missing the following keys {...}
Proposed error message
Actual object is missing elements with the following keys {...}
(there may be other messages about other types that would benefit from a similar treatment)
When a match on a JSON object fails, the rust core can generates error messages like:
In some languages, this is confusing because there is no
map
type in JSON (and there may be a nativeMap
type that isn't used at all for JSON, as is the case in JavaScript).I don't think Pact should have an opinion on which language's terms for things are "correct" - and I certainly don't want to get into a discussion about preferences for terms. In this case, I think it would be best to use the terms from JSON specs instead - they're common, and it's hard to argue with what the format calls them. The JSON specs are RFC 8259 and ECMA-404) - these are summarised at json.org here.
Current error message:
Proposed error message
(there may be other messages about other types that would benefit from a similar treatment)