generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
The server rpcv2Cbor implementation seems like it can't deserialize operations that don't have any input. I was following this part of the Smithy Java quick-start example, and it works fine for restJson1 but not for rpcv2Cbor. I get the following error message:
software.amazon.smithy.java.core.serde.SerializationException: Can't read FINISHED as a struct
at software.amazon.smithy.java.cbor.CborDeserializer.badType(CborDeserializer.java:140)
at software.amazon.smithy.java.cbor.CborDeserializer.readStruct(CborDeserializer.java:290)
at io.smithy.java.server.example.model.GetHoursInput$Builder.deserialize(GetHoursInput.java:99)
at io.smithy.java.server.example.model.GetHoursInput$Builder.deserialize(GetHoursInput.java:83)
at software.amazon.smithy.java.core.serde.Codec.deserializeShape(Codec.java:129)
at software.amazon.smithy.java.server.protocols.rpcv2.RpcV2CborProtocol.lambda$deserializeInput$0(RpcV2CborProtocol.java:80)
at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:684)
at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662)
at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2168)
at software.amazon.smithy.java.server.protocols.rpcv2.RpcV2CborProtocol.deserializeInput(RpcV2CborProtocol.java:79)
at software.amazon.smithy.java.server.core.ProtocolHandler.before(ProtocolHandler.java:14)
at software.amazon.smithy.java.server.core.SingleThreadOrchestrator$JobWork.run(SingleThreadOrchestrator.java:98)
at software.amazon.smithy.java.server.core.SingleThreadOrchestrator$ConsumerTask.run(SingleThreadOrchestrator.java:156)
at java.base/java.lang.Thread.run(Thread.java:833)
I'm not sure if there's something extra that I need to configure, to replicate this behavior:
- Complete the Java Quickstart example (including the "Make a change to the service" section).
- Replace
restJson1withrpcv2Cborin theCoffeeShopservice model - Replace the
restJsonserver implementation dependency with therpcv2Cborone in the server build script - Replace the
restJsonclient implementation dependency with therpcv2Cborone in the client build script - Replace the
restJsonprotocol configuration withrpcv2Cborconfiguration in the client smithy build file - Run the server, then the client application.
I also tried the same no-input operation with a Smithy Kotlin client instead of a Smithy Java client and the same thing happens.
Metadata
Metadata
Assignees
Labels
No labels