Skip to content

JCL-134: no strings in tests & improved serializers - #95

Merged
timea-solid merged 9 commits into
mainfrom
JCL-134-nostrings
Oct 19, 2022
Merged

timea-solid merged 9 commits into
mainfrom
JCL-134-nostrings

Conversation

@timea-solid

@timea-solid timea-solid commented Oct 19, 2022 •

Copy link
Copy Markdown
Contributor

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.

@timea-solid
timea-solid requested a review from acoburn as a code owner October 19, 2022 09:13
Comment thread jsonb/pom.xml Outdated
Comment thread jsonb/pom.xml Outdated
@timea-solid
timea-solid merged commit faba82d into main Oct 19, 2022
@timea-solid
timea-solid deleted the JCL-134-nostrings branch October 19, 2022 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants