[MS-1076] Fix: SID is not handling the enrolment record events when there is the metadata field#1275
Merged
Conversation
…025.2.0 # Conflicts: # infra/event-sync/src/main/java/com/simprints/infra/eventsync/event/remote/models/callout/ApiConfirmationCallout.kt # infra/events/src/main/java/com/simprints/infra/events/event/domain/models/callout/ConfirmationCalloutEvent.kt
…ype. Adding `@JsonTypeInfo(use = JsonTypeInfo.Id.NONE)` annotation to the metadata field to prevent Jackson from treating the `metadata` field as polymorphic.
…erageReports annotation to exclude from Sonar test coverage
luhmirin-s
reviewed
Jul 21, 2025
| val templates: List<ApiFaceTemplate>, | ||
| val format: String, | ||
| // [MS-1076] The parent 'ApiBiometricReference' class should have its JsonSubTypes annotation updated to | ||
| // @JsonSubTypes.Type([...], looseHandling = true) once we update to SDK => 25 and Jackson => 2.16.0. |
Contributor
There was a problem hiding this comment.
once we update to SDK => 25
if :D
luhmirin-s
approved these changes
Jul 21, 2025
BurningAXE
approved these changes
Jul 21, 2025
…tCoverageReports annotation to exclude from Sonar test coverage
|
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.



JIRA ticket
Will be released in: 2025.2.0
Root cause analysis (for bugfixes only)
Jackson attempted to resolve the subtype for the
metadatafield. Because this field is within a polymorphic class (ApiBiometricReference), deserialization failed with a missing type error.First known affected version: 2025.2.0 (testing phase)
Could not resolve subtype of [map type; class java.util.HashMap, [simple type, class java.lang.String] -> [simple type, class java.lang.String]]: missing type id property 'type' (for POJO property 'metadata')It is caused by the
Jacksonlibrary applying polymorphic deserialization to themetadatafield. This property is inherited from a base class using a@JsonTypeInfoannotation.Note: added comments to change the implementation to the one suggested here: Add new
OptBooleanvalued property in@JsonTypeInfo, handling, to allow per-polymorphic type loose Type Id handling FasterXML/jackson-databind#3877 (comment)Current MinSDK prevents us from updating Jackson, hence the current implementation with explicit annotation in the subclasses
Testing guidance
Use dev environment, and login into the
m0Zk7c28tbpMkdTcIBm8project. This project contains the8eaee786-f749-4059-872a-9fc3ff454c42event, containing the metadate, and it should be parsed correctly (keep an eye on logs, as the crash doesn't stop the application from running)Additional work checklist