Skip to content

[OC-7791] Tokenization - Updated deserialization for stricter parsing#100

Open
trongvnau wants to merge 1 commit intofireblocks:masterfrom
trongvnau:oc-7791_bugfix_tokenization_deserialization
Open

[OC-7791] Tokenization - Updated deserialization for stricter parsing#100
trongvnau wants to merge 1 commit intofireblocks:masterfrom
trongvnau:oc-7791_bugfix_tokenization_deserialization

Conversation

@trongvnau
Copy link

Pull Request Description

Deserializer for TokenLinkDtoTokenMetadata is not strict enough and pick up all 3 subtypes: AssetMetadataDto, CollectionMetadataDto and ContractMetadataDto and throws an exception even though for example the json is for AssetMetadataDto and has only properties that belong to AssetMetadataDto

Example SDK call TokenLinkDto data = fireblocks.tokenization().getLinkedToken(idToken).join().getData();

Exception thrown

java.util.concurrent.CompletionException: com.fireblocks.sdk.ApiException: com.fasterxml.jackson.databind.JsonMappingException: Unexpected IOException (of type java.io.IOException): Failed deserialization for TokenLinkDtoTokenMetadata: 3 classes match result, expected 1

Fixes (link to the issue here)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Chore / Documentation
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Locally tested against Fireblocks API

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules
  • I have added corresponding labels to the PR

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