This repository was archived by the owner on Nov 28, 2025. It is now read-only.
Allow deserializing string-only text component #8
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 #1 by implementing a custom deserializer for
Componentin the form ofJsonTransformingSerializer, which transforms string-only components with their equivalent object-form component and otherwise delegates to the plugin-generated serializer. A test is added to check the behavior.This also adjusts the "Run Tests" run configuration slightly to remove a reference to a named JRE, so the run configuration works with the module JRE.
The second part of that issue regarding a crash for the
extrasfield in JSON deserialization seems to not be applicable, perhaps due to the rewrite made in the commit immediately after the one the linked issue mentions.Side-notes:
Component(text = "test") == Component(text = "test")evaluates tofalse. I'm not knowledgeable enough in Kotlin to understand why that happens though.LICENSEfile or otherwise at the root of the repository.(P.S. Could I please ask you to add the
hacktoberfesttopic to your repository, or label this with ahacktoberfest-acceptedlabel? Thank you!)