feat: migrate from Jackson 2 to Jackson 3#1571
Draft
yvasyliev wants to merge 18 commits intorubenlagus:devfrom
Draft
feat: migrate from Jackson 2 to Jackson 3#1571yvasyliev wants to merge 18 commits intorubenlagus:devfrom
yvasyliev wants to merge 18 commits intorubenlagus:devfrom
Conversation
…o`; revert code format; rename instance variable
…ndencies management with BOM imports
Author
|
Hi @rubenlagus while we're waiting for the Lombok stable release, could you please start an initial review? Thank you! |
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.
Caution
THIS PR IS IN PROGRESS. PLEASE DO NOT MERGE IT.
As part of #1561 suggestion, I'm creating this request to migrate
TelegramBotsfrom Jackson 2 to Jackson 3.Changelist
Based on the Jackson 3 Migration Guide, the next changes were applied.
Cross-module
The following changes were applied to all modules:
com.fasterxml.jackson.*Jackson 2 dependencies were replaced with a singletools.jackson.coreJackson 3 dependency.1.18.34toedge-SNAPSHOTto make@Jacksonizedannotation compatible with Jackson 3. (TODO: bump to stable version)5.12.2to6.0.3; added BOM import.5.12.0to5.21.0; added BOM import.lombok.configfile to enable Jackson 3-compatible@Jacksonizedconfiguration.com.fasterxml.jackson.*Jackson 2 package imports withtools.jackson.*Jackson 3 package imports where relevant across the code.ObjectMapperwith Jackson 3JsonMapper(a core JSON reader/writer in Jackson 3) across the code.IOExceptionwithJacksonException(extendsRuntimeException) in thethrowslists andcatchblocks where relevant across the code.JsonMapper.Module-specific
The following changes were applied to specific modules only:
telegrambots-metaorg.telegram.telegrambots.meta.api.objects.InputFileSerializerwithorg.telegram.telegrambots.meta.api.objects.InputFileConverter.org.telegram.telegrambots.meta.api.objects.inlinequery.inputmessagecontent.serialization.InputMessageContentDeserializerwas removed in favor of@com.fasterxml.jackson.annotation.JsonTypeInfo.@JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)toorg.telegram.telegrambots.meta.api.objects.Contactandorg.telegram.telegrambots.meta.api.objects.stories.StoryAreaPositionto make Jackson 3 ignore getters during serialization. Without it, Jackson 3 will create an extra field in a serialized object (e.g.,vcardandVCard).org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException.telegrambots-webhookorg.telegram.telegrambots.webhook.Jackson3Mapperadapter class to enable Javalin work with Jackson 3. Javalin project doesn't support Jackson 3 out-of-the-box just yet,telegrambots-abilitiesPolymorphicTypeValidatorconfiguration, because the default one doesn't pass all tests.