fix: update dependencies from JSON3 to JSON and increment version to …#16
fix: update dependencies from JSON3 to JSON and increment version to …#16AbrJA wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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
:JSON3to:JSON. - Removed JSON3 from
Project.toml, added JSON as a test extra, and bumped version to0.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.
| function load_fixture_file(filepath::String) | ||
| return JSON3.read(read(filepath, String)) | ||
| return JSON.parse(read(filepath, String)) | ||
| end |
There was a problem hiding this comment.
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.
| """ | ||
| 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] |
There was a problem hiding this comment.
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).
…0.2.0
Linked Issue
Closes #15
Closes #
Description
JSON3 has been deprecated. This PR migrates to JSON.jl v1
Type of Change
Changes Made
Change the usage of JSON3 to JSON
Testing
Pre-submission Checklist
Breaking Changes