Skip to content

Cannot serialize shape type bigDecimal on protocol, shape: smithy.api#BigDecimal. #1627

Open
@TheHarpyEagle

Description

@TheHarpyEagle

Hi Team, I am using @restJson1 protocol for my service. One of the operation's input is of BigDecimal type as a member of operation input structure

$version: "2.0"

namespace com.amazon.xyz.v1

use aws.auth#sigv4
use aws.api#service
use aws.protocols#restJson1

@service(
    sdkId: "xyz",
    arnNamespace: "xyz"
)
@sigv4(name: "xyz")
@restJson1
@documentation("xyz interfaces")
service XYZService {
    version: "1.0",
    operations : [
        GetCost
    ]
}

@readonly
operation GetCost {
    input: GetCostRequest
    output: GetCostResponse
    errors: [
    ]
}



@input
structure GetCostRequest {

}

@output
structure GetCostResponse {
  amount: BigDecimal
}

However, when trying to generate TS Code; I am getting below error

     [java] Projection source failed: software.amazon.smithy.codegen.core.CodegenException: Cannot serialize shape type bigDecimal on protocol, shape: smithy.api#BigDecimal.
     [java] software.amazon.smithy.codegen.core.CodegenException: Cannot serialize shape type bigDecimal on protocol, shape: smithy.api#BigDecimal.
     [java]     at software.amazon.smithy.aws.typescript.codegen.JsonMemberSerVisitor.unsupportedShape(JsonMemberSerVisitor.java:140)
     [java]     at software.amazon.smithy.aws.typescript.codegen.JsonMemberSerVisitor.bigDecimalShape(JsonMemberSerVisitor.java:67)
     [java]     at software.amazon.smithy.aws.typescript.codegen.JsonMemberSerVisitor.bigDecimalShape(JsonMemberSerVisitor.java:43)

Can someone help understand why this error is happening ? What are the alternative in-case.

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