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

Fix for generation of invalid json #113

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Conversation

dgsuarez
Copy link
Contributor

@dgsuarez dgsuarez commented Dec 4, 2024

Seems like the fix introduced in f54a97c has a couple of issues:

  • It doesn't insert the newline for arrays
  • It inserts newlines when it finds {} or [] inside a string in the json document, which makes it an invalid document.

We've ran into the second issue, it's preventing us from upgrading since some of our pipelines fail.

The solution is hacky, it relies on the json being pretty formatted. In that case each line should have a single value, and the {} or [], with an extra , should be the last content in the line.

{
  "empty_array": [],
  "other": {
    "more": "fields"
  },
  "empty_hash": {}
}

@dgsuarez dgsuarez changed the title [MASTER-🍅] Fix for generation of invalid json Fix for generation of invalid json Dec 4, 2024
@dgsuarez dgsuarez marked this pull request as ready for review December 4, 2024 07:58
@YOU54F
Copy link
Member

YOU54F commented Dec 4, 2024

thanks @dgsuarez, appreciate the extra eyes and fix

could you update the commit to fix: desc as we use our commit messages in the release process to choose the correct version number.

without it, it won’t recognise the change at release time

@dgsuarez
Copy link
Contributor Author

dgsuarez commented Dec 5, 2024

Got it, done @YOU54F 👍

@YOU54F YOU54F merged commit 18e23f0 into pact-foundation:master Dec 5, 2024
15 checks passed
@YOU54F
Copy link
Member

YOU54F commented Dec 5, 2024

Cheers Diego! 🙌🏾

@YOU54F
Copy link
Member

YOU54F commented Dec 5, 2024

now released

https://github.com/pact-foundation/pact-support/releases/tag/v1.21.2

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

Successfully merging this pull request may close these issues.

2 participants