Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specific asset service returns multiple MismatchedInputException(s) #2

Open
MarkBlythe opened this issue Feb 4, 2022 · 1 comment

Comments

@MarkBlythe
Copy link

I have started building an application in Spring Boot and have written a couple of services that use the Blockfrost API with no issue however the AssetService getAsset method returns:

[Request processing failed; nested exception is io.blockfrost.sdk.api.exception.APIException: Error getting asset] with root cause

com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.String` from Array value (token `JsonToken.START_ARRAY`)
 at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 539] (through reference chain: io.blockfrost.sdk.api.model.Asset["onchain_metadata"]->java.util.LinkedHashMap["files"])
	at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59) ~[jackson-databind-2.13.1.jar:2.13.1]

on some of the assets and also this on others:

com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.String` from Object value (token `JsonToken.START_OBJECT`)
 at [Source: (okhttp3.ResponseBody$BomAwareReader); line: 1, column: 576] (through reference chain: io.blockfrost.sdk.api.model.Asset["onchain_metadata"]->java.util.LinkedHashMap["attributes"])

To get to this stage I have followed the docs to do the following:

Use the AddressService to get the asset <Lovelace or concatenation of asset policy_id and hex-encoded asset_name> from one of the unit keys in the response.

Then tried to pass that as the asset following the examples here: https://docs.blockfrost.io/#tag/Cardano-Assets/paths/~1assets~1{asset}/get

I believe that the asset returned by the address query is the exact same asset required by the asset endpoint but please let me know if I've misunderstood.

@bentaye
Copy link
Contributor

bentaye commented Mar 12, 2022

It seems to me that this is the same issue as #3
Some fields of the onchain_metadata object are not Strings

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

No branches or pull requests

2 participants