[F] Fix import/export disparity, fix jackson3 export isSomething serialization bug, add tests - #237
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades and aligns JSON serialization/deserialization behavior around Jackson 3, with a focus on ensuring exported game backup JSON can be re-imported without data changes and fixing Spring Boot 4/Jackson 3 boolean is* property serialization in HTTP responses. It also adjusts integration-style tests so they鈥檙e automatically skipped when no live server is running.
Changes:
- Introduces a shared Jackson 3
JsonMapperSpring bean (with Kotlin module) and updates serialization/deserialization helpers to restore correctis*boolean property naming and improve date-time handling (including legacy array formats). - Migrates various mappers/serializers/handlers to Jackson 3 (
tools.jackson.*) APIs and exception types. - Adds import/export parity and date parsing regression tests; gates live-server integration tests via
liveTest(...)so CI won鈥檛 fail when no server is available.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/kotlin/test/WaccaTest.kt | Converts integration tests to liveTest(...) so they鈥檙e skipped when no live server is listening. |
| src/test/kotlin/test/Mai2Test.kt | Same live-server gating conversion for Mai2 integration tests. |
| src/test/kotlin/test/ImportExportParityTest.kt | New round-trip JSON parity tests for CHUNITHM/maimai DX/ONGEKI exports (including LocalDateTime text serialization checks). |
| src/test/kotlin/test/Chu3ImportJsonTest.kt | Adds regression coverage for legacy LocalDateTime array imports and updates expected Jackson 3 exception/message behavior. |
| src/test/kotlin/ext/TestExt.kt | Adds LIVE_SERVER_AVAILABLE probe and liveTest(...) helper for conditional test registration. |
| src/main/java/icu/samnyan/aqua/sega/util/Serializers.kt | Migrates custom serializers/deserializers to Jackson 3 APIs and token access patterns. |
| src/main/java/icu/samnyan/aqua/sega/util/GameDataService.kt | Updates TypeReference import to Jackson 3 package. |
| src/main/java/icu/samnyan/aqua/sega/util/BasicMapper.kt | Rebuilds BASIC/STRING mappers using Jackson 3 builder APIs and updated enum feature configuration. |
| src/main/java/icu/samnyan/aqua/sega/ongeki/model/OngekiUserEntities.kt | Updates databind annotation import to Jackson 3. |
| src/main/java/icu/samnyan/aqua/sega/maimai2/model/userdata/UserEntities.kt | Updates custom LocalDateTime serializer to Jackson 3 serializer/context types. |
| src/main/java/icu/samnyan/aqua/sega/maimai2/model/userdata/Mai2UserDetail.kt | Updates databind annotation import to Jackson 3. |
| src/main/java/icu/samnyan/aqua/sega/maimai2/handler/UpsertUserAllHandler.kt | Updates thrown exception type to Jackson 3 base exception. |
| src/main/java/icu/samnyan/aqua/sega/general/BaseHandler.kt | Updates handler exception contract to Jackson 3 base exception. |
| src/main/java/icu/samnyan/aqua/sega/diva/util/DivaUtils.kt | Updates serializer provider/context types for Jackson 3. |
| src/main/java/icu/samnyan/aqua/sega/diva/util/DivaMapper.kt | Moves module registration into Jackson 3 builder flow and updates imports. |
| src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/UserMusicDetail.kt | Updates databind annotation import to Jackson 3. |
| src/main/java/icu/samnyan/aqua/sega/chusan/model/userdata/Chu3UserData.kt | Enhances flexible date-time deserialization to accept legacy arrays and improves mismatch error reporting under Jackson 3. |
| src/main/java/icu/samnyan/aqua/sega/cardmaker/CardMakerControllerAdvice.kt | Updates mapper instantiation/imports to Jackson 3 JsonMapper. |
| src/main/java/icu/samnyan/aqua/net/games/ImportHelper.kt | Updates custom module deserializer base type and switches mapper cloning to Jackson 3 rebuild API. |
| src/main/java/icu/samnyan/aqua/net/games/ImportController.kt | Updates exception filtering to Jackson 3 exception hierarchy. |
| src/main/java/ext/Json.kt | Reworks shared JACKSON mapper setup for Jackson 3, adds legacy LocalDateTime array parsing, and exposes a Spring JsonMapper bean to ensure Kotlin module usage for HTTP responses. |
| build.gradle.kts | Removes Jackson 2 kotlin/jsr310 deps and adds Jackson 3 kotlin module dependency. |
馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.