-
Notifications
You must be signed in to change notification settings - Fork 2
fix: update dependencies from JSON3 to JSON and increment version to … #16
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ Uses Julia Artifacts to download fixtures from the official spec repository. | |
|
|
||
| using Test | ||
| using ToonFormat | ||
| using JSON3 | ||
| using JSON | ||
| using JSONSchema | ||
| using LazyArtifacts | ||
|
|
||
|
|
@@ -62,7 +62,7 @@ function get_fixture_schema() | |
| if _FIXTURE_SCHEMA[] === nothing | ||
| if isfile(SCHEMA_PATH) | ||
| try | ||
| schema_json = JSON3.read(read(SCHEMA_PATH, String)) | ||
| schema_json = JSON.parse(read(SCHEMA_PATH, String)) | ||
| _FIXTURE_SCHEMA[] = JSONSchema.Schema(schema_json) | ||
| catch e | ||
| @warn "Failed to load fixtures schema: $e" | ||
|
|
@@ -122,22 +122,23 @@ end | |
| Load a fixture file and return parsed JSON. | ||
| """ | ||
| function load_fixture_file(filepath::String) | ||
| return JSON3.read(read(filepath, String)) | ||
| return JSON.parse(read(filepath, String)) | ||
| end | ||
|
|
||
| # ============================================================================= | ||
| # Helper functions (existing, preserved) | ||
| # ============================================================================= | ||
|
|
||
| """ | ||
| 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] | ||
|
Comment on lines
132
to
142
|
||
| else | ||
| return val | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JSON.parsereturnsDict/Vectorwith 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, ...)). WithDict{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.