Conversation
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace StructTypes.CustomStruct/lower/lowertype with StructUtils.lower for GeoJSONWrapper - Replace StructTypes.AbstractType/subtypekey/subtypes with JSON.@choosetype macro - Add _choose_geometry_type and _choose_geojson_type functions for polymorphic parsing - Replace StructTypes.excludes with StructUtils.@exclude for FeatureCollection - Remove StructTypes.omitempties (now handled at call site with omit_null=true) - Remove redundant StructType declarations for concrete types (default struct behavior) This completes Task 6 of the JSON3 to JSON.jl migration. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit completes the migration by implementing custom StructUtils.make and StructUtils.lift methods to replace JSON3's @choosetype macro functionality. Key changes: - Implemented custom type choosers for AbstractGeometry and GeoJSONT - Added StructUtils.lift method for handling JSON.Object conversion - Updated GeoJSONWrapper with manual type selection logic - Fixed FeatureCollection field types to handle JSON parsing edge cases - Improved write() methods to return nothing for IO operations - Enhanced read() to handle both file paths and JSON strings - Added helper functions for coordinate type conversion All tests passing (234/234). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Capture each feature's raw JSON via JSON's JSONText span finder and re-parse on access, and write lazy features and collections back out verbatim.
JSON downgrades to the inner DefaultStyle before calling lift, so match DefaultStyle exactly: the method is reached at runtime and no longer overlaps JSON's JSONReadStyle lift that Aqua flagged.
The active lowering splatted every struct field, so FeatureCollections emitted their internal name/type cache and features wrote absent id, bbox and crs members as null. Prune the computed fields and omit the empty optional members (matching the old omitempties), and remove the dead single-argument lowerings that JSON never dispatched to.
Reading 3D data without ndim=3 silently dropped the Z coordinate: NTuple and StructUtils both truncate an over-long array rather than erroring, so read's 2D->3D fallback never triggered. Route both the lazy make path and the materialized lift path through one strict builder that rejects a wrong-dimension coordinate, restoring the fallback and collapsing the two duplicated construction paths into one. Also clarify why the type choosers can't use @choosetype.
Its abstract branch duplicated the GeoJSONWrapper chooser and its concrete branch just re-invoked the default struct parse, so removing it changes nothing — the full suite still passes.
Swapping JSON3/StructTypes for JSON.jl/StructUtils changes dependencies and serialization details, so bump the minor version rather than the patch to signal the break.
Member
|
Thank you @simsurace. Any update here? JSON3.jl now shows a |
Author
|
I'm waiting for someone to review this PR. |
Member
|
So this approach seems to tank performance quite a bit, probably an issue in my initial implementation. Will probably give it a shot from scratch sometime next week. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JSON3.jl is deprecated, so this should probably be done sooner rather than later.
This bumps the version to 0.9 to be on the safe side because some serialization details may change here.