Skip to content

fix: update dependencies from JSON3 to JSON and increment version to …#16

Open
AbrJA wants to merge 1 commit into
toon-format:mainfrom
AbrJA:main
Open

fix: update dependencies from JSON3 to JSON and increment version to …#16
AbrJA wants to merge 1 commit into
toon-format:mainfrom
AbrJA:main

Conversation

@AbrJA
Copy link
Copy Markdown

@AbrJA AbrJA commented Apr 24, 2026

…0.2.0

Linked Issue

Closes #15

Closes #

Description

JSON3 has been deprecated. This PR migrates to JSON.jl v1

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Changes Made

Change the usage of JSON3 to JSON

Testing

  • All existing tests pass
  • Added new tests for changes
  • Tests cover edge cases and spec compliance

Pre-submission Checklist

  • My code follows the project's coding standards
  • I have run code formatting/linting tools
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally
  • I have updated documentation if needed
  • I have reviewed the TOON specification for relevant sections

Breaking Changes

  • No breaking changes
  • Breaking changes (describe migration path below)

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Migrates the package away from the deprecated JSON3.jl dependency by updating test parsing code to use JSON.jl and updating package metadata accordingly.

Changes:

  • Replaced JSON3 usage in spec-fixture tests with JSON.jl parsing.
  • Updated Aqua stale-dependency ignore list from :JSON3 to :JSON.
  • Removed JSON3 from Project.toml, added JSON as a test extra, and bumped version to 0.2.0.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
test/test_spec_fixtures.jl Switches fixture/schema parsing from JSON3 to JSON.jl and updates normalization logic.
test/test_aqua.jl Updates Aqua stale-deps ignore list to reflect JSON.jl usage in tests.
Project.toml Removes JSON3 dep, adds JSON as a test extra/compat, and bumps package version.

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

Comment on lines 124 to 126
function load_fixture_file(filepath::String)
return JSON3.read(read(filepath, String))
return JSON.parse(read(filepath, String))
end
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

JSON.parse returns Dict/Vector with String keys, but the rest of this test file still treats parsed fixtures as JSON3-style objects (e.g., fixture_data.tests, get(fixture_data, :tests, ...), test.name, get(test, :shouldError, ...)). With Dict{String,Any} this will throw at runtime. Update the fixture accessors to use string keys/indexing (e.g., fixture_data["tests"], get(fixture_data, "tests", []), test["name"], etc.), or add an explicit conversion layer that preserves the existing symbol/getproperty access pattern.

Copilot uses AI. Check for mistakes.
Comment on lines 132 to 142
"""
Convert JSON3 objects to native Julia types for comparison.
Convert JSON objects to native Julia types for comparison.
Note: JSON.parse() already returns native Julia types (Dict, Array), so minimal conversion needed.
"""
function normalize_json(val)
if val isa JSON3.Object
if val isa Dict
return ToonFormat.JsonObject(
string(k) => normalize_json(v) for (k, v) in pairs(val)
)
elseif val isa JSON3.Array || val isa Vector
elseif val isa Vector
return [normalize_json(v) for v in val]
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

The docstring says JSON.parse() already returns native types so only minimal conversion is needed, but normalize_json still converts objects into ToonFormat.JsonObject (an OrderedDict) for comparisons. Consider updating the docstring to reflect the actual purpose (convert parsed JSON into ToonFormat’s canonical JSON model), and consider using AbstractDict/AbstractVector instead of Dict/Vector to avoid missing other dict/array implementations (e.g., OrderedDict).

Copilot uses AI. Check for mistakes.
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.

JSON3.jl deps

2 participants