Repository navigation
JCL-134: no strings in tests & improved serializers - #95
Merged
Merged
Conversation
acoburn
approved these changes
Oct 19, 2022
timea-solid
commented
Oct 19, 2022
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.
This PR fixes some issues in the JSON serializers regarding VC module. It also fixes VC module tests and makes them cleaner.
To reviews, especially:
-> creation of a random folder and file in 'target';
-> json serializers/adapters & the recursive method in jsonb Adapters 'addRightJsonType';
-> vc tests refactoring
Note on the recursive method:
it took me a loooong enough time to find a working solution for Jsonb. It seems a solution is not documented online (at least among the dozens of sites I checked). While jackson has a solution, which is not that obvious (writePOJO), this wrong behavior seems to be aligned in some more json libs (for example in our: jakarta.json). The problem is the toString() which escapes double quotes so my string
"something"becomes"\"something\"".The recursive method I came up with was just more elegant here.
What I learned: jackson is more liberal in input while jakarta.json is more restrictive (so much to the Robustness principle differences, which now I will remember for sure ;) )
And another note -> a lot of satckoverflow solutions just said to do stringReplace of
\"on the resulting JSON. aaaaa... NO!!And for all these reasons, I will write out a technical blog post about this topic.