Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON match messages use terms that aren't applicable to all langauges #222

Open
TimothyJones opened this issue Oct 17, 2022 · 0 comments
Open

Comments

@TimothyJones
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant