Skip to content

Json: set allow_duplicate_key in JSON.parse call#21709

Merged
MikeMcQuaid merged 1 commit into
mainfrom
livecheck/json-set-allow_duplicate_key
Mar 11, 2026
Merged

Json: set allow_duplicate_key in JSON.parse call#21709
MikeMcQuaid merged 1 commit into
mainfrom
livecheck/json-set-allow_duplicate_key

Conversation

@samford

@samford samford commented Mar 11, 2026

Copy link
Copy Markdown
Member
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

brew livecheck querious is producing a warning in reference to the JSON.parse call in livecheck's Json.parse_json method: 'warning: detected duplicate key "prerelease" in JSON object. This will raise an error in json 3.0 unless enabled via allow_duplicate_key: true at line 1 column 1'. We don't have any control over upstream JSON data, so this adds an allow_duplicate_key: true option to the JSON.parse call to resolve this issue and maintain the current behavior.

`brew livecheck querious` is producing a warning in reference to the
`JSON.parse` call in livecheck's `Json.parse_json` method: 'warning:
detected duplicate key "prerelease" in JSON object. This will raise an
error in json 3.0 unless enabled via `allow_duplicate_key: true` at
line 1 column 1'. We don't have any control over upstream JSON data,
so this adds an `allow_duplicate_key: true` option to the `JSON.parse`
call to resolve this issue and maintain the current behavior.
Copilot AI review requested due to automatic review settings March 11, 2026 01:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Homebrew livecheck’s JSON strategy to preserve current parsing behavior when upstream JSON contains duplicate keys, avoiding warnings now and preventing failures with newer json versions.

Changes:

  • Passes allow_duplicate_key: true to JSON.parse in Livecheck::Strategy::Json.parse_json.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Library/Homebrew/livecheck/strategy/json.rb

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit 01f0c20 Mar 11, 2026
61 of 62 checks passed
@MikeMcQuaid MikeMcQuaid deleted the livecheck/json-set-allow_duplicate_key branch March 11, 2026 08:51
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.

4 participants