• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aspectran / aspectran / #4753

07 Nov 2025 02:49PM UTC coverage: 38.919% (+0.2%) from 38.685%
#4753

push

github

topframe
feat(json): Enhance JSON parsing and serialization

This commit introduces several improvements and fixes to the JSON utility classes.

- **JsonWriter:**
    - Introduced `JsonSerializer` interface and `registerSerializer` method to support extensible custom object serialization.
    - Fixed a bug where an empty `JsonString` caused an `EOFException`; it now correctly writes `null`.
    - Corrected the custom serializer invocation logic to prevent duplicate spacing issues.
    - Refactored the internal `pendedName` variable to `pendingName` for improved clarity.

- **JsonReader:**
    - Modified `doPeek()` method to allow trailing commas in objects when lenient parsing is enabled.

- **Tests:**
    - Refactored `JsonParserTest` to include complex structure and whitespace handling tests.
    - Streamlined `JsonReaderTest` to focus solely on `JsonReader`'s core tokenizing functionality.
    - Enhanced `JsonWriterTest` with clearer method names and comprehensive tests for compact output, simple values, custom indentation, and the new serializer functionality.

32 of 36 new or added lines in 2 files covered. (88.89%)

14 existing lines in 1 file now uncovered.

16190 of 41599 relevant lines covered (38.92%)

0.39 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.0
/utils/src/main/java/com/aspectran/utils/apon/JsonToParameters.java


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc