API Gateway mapping template transformation causes a precision error for exponential notation

0

Hello AWS re:Post professionals. Thanks in advance and I would like to ask a question about API Gateway mapping templates.

Situation: I have tried to post JSON that includes exponential notation API Gateway that uses mapping template and saw response below.

posted value

Method request body before transformations: {
...
"value": 5e+22
}
endpoint request body after transformations:     {
...
value: \"4.9999999999999996E22\" 
}

In mapping template, I have found that after the line below, value: 5e+22 was converted to 4.9999999999999996E22

#set($inputRoot = $input.path('$'))

My Question is that is there any way to avoid this implicit transformation?

Best regards, Keisuke

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인