-
Notifications
You must be signed in to change notification settings - Fork 641
Disallow missing commas between fields (#2287 #2520) #2889
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: dev
Are you sure you want to change the base?
Conversation
Hi @sandwwraith, could you please take a look at failed build? I believe it's not caused by this PR and I shouldn't/can't fix it in this PR |
Sure, I'll restart the build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Thanks for the great PR! I love the idea overall, but I have several comments on implementation.
formats/json-tests/commonTest/src/kotlinx/serialization/json/MissingCommaTest.kt
Outdated
Show resolved
Hide resolved
formats/json-tests/commonTest/src/kotlinx/serialization/json/MissingCommaTest.kt
Show resolved
Hide resolved
formats/json/commonMain/src/kotlinx/serialization/json/internal/StreamingJsonDecoder.kt
Outdated
Show resolved
Hide resolved
formats/json/commonMain/src/kotlinx/serialization/json/internal/lexer/AbstractJsonLexer.kt
Outdated
Show resolved
Hide resolved
Just a quick update from me: I've reviewed the PR and I'm mostly satisfied with the changes. However, I also ran the decoding benchmarks and unfortunately, scores for them dropped for about 6-8%:
I will try to investigate whether it is possible to restructure some changes to optimize it further or if we have to accept this performance hit for the sake of correctness. |
Yeah I think performance hit comes from this change Lines 113 to 117 in f9f160a
|
Fixes #2287 and #2520, makes sure that comma between key-value pairs is required in
Json.decodeFromString