Skip to content

Jackson error on parsing Smart Transfer Ticket creation response #112

@alexeyabar

Description

@alexeyabar

Hello,

Observed this issue in SDK versions 12.1.0 and 12.0.0. Works fine in 11.2.0.

Creating Smart Transfer Ticket on Fireblocks Sandbox env. According to Fireblocks Console, ticket is successfully created, but I receive Jackson exception in my code.

Code sample:

@Produces
public Fireblocks create() {
    var configurationOptions = new ConfigurationOptions()
                .basePath(BasePath.Sandbox)
                .apiKey(apiKey)
                .secretKey(secretKey);
    return new Fireblocks(configurationOptions);
}

public void sample() {
    try {
        var request = new SmartTransferCreateTicket()
            .type(SmartTransferCreateTicket.TypeEnum.ASYNC)
            .createdByNetworkId(fmNetworkId)
            .note("Test SDK 12.1.0")
            .externalRefId("externalRef")
            .submit(true)
            .terms(
                List.of(
                    new SmartTransferCreateTicketTerm()
                        .fromNetworkId(from)
                        .toNetworkId(to)
                        .asset(asset)
                        .amount(amount);
                )
            );

        var response = fireblocks.smartTransfer()
            .createTicket(request, generateIdempotenceKey())
            .get();
        log.infof("Got response: '%s'", response);
    } catch (ApiException | ExecutionException | InterruptedException e) {
        // breakpoint here
    }
}

Exception details from breakpoint:

java.util.concurrent.ExecutionException: com.fireblocks.sdk.ApiException: com.fasterxml.jackson.databind.exc.MismatchedInputException: Missing required creator property 'message' (index 0)
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 1177] (through reference chain: com.fireblocks.sdk.model.SmartTransferTicketResponse["message"])

And some stacktrace for it:

Caused by: com.fireblocks.sdk.ApiException: com.fasterxml.jackson.databind.exc.MismatchedInputException: Missing required creator property 'message' (index 0)
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 1177] (through reference chain: com.fireblocks.sdk.model.SmartTransferTicketResponse["message"])
	at com.fireblocks.sdk.api.SmartTransferApi.lambda$createTicket$2(SmartTransferApi.java:305)
	at [email protected]/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150)
	at [email protected]/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	at [email protected]/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at [email protected]/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at [email protected]/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at [email protected]/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at [email protected]/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Missing required creator property 'message' (index 0)
 at [Source: UNKNOWN; line: 1, column: 1177] (through reference chain: com.fireblocks.sdk.model.SmartTransferTicketResponse["message"])
	at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)
	at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1808)
	at com.fasterxml.jackson.databind.deser.impl.PropertyValueBuffer._findMissing(PropertyValueBuffer.java:276)
	at com.fasterxml.jackson.databind.deser.impl.PropertyValueBuffer.getParameters(PropertyValueBuffer.java:207)
	at com.fasterxml.jackson.databind.deser.ValueInstantiator.createFromObjectWith(ValueInstantiator.java:301)
	at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:267)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:535)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1499)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:340)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:177)
	at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:342)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4971)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3887)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3870)
	at com.fireblocks.sdk.api.SmartTransferApi.lambda$createTicket$2(SmartTransferApi.java:300)
	... 7 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions