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

Large Double value getting converted to the corresponding scientific value in JSON transform mediator #2692

Closed
GDLMadushanka opened this issue Apr 11, 2022 · 0 comments · Fixed by wso2/wso2-synapse#1939 or wso2/wso2-synapse#1950
Labels

Comments

@GDLMadushanka
Copy link
Contributor

Description:
When the json schema is used to convert the incoming payload attribute with large double value to number type, the converted payload contains the corresponding scientific value for the attribute which is not expected.

Suggested Labels:
Bug

Affected Product Version:
EI-6.6.0

Steps to reproduce:
Schema

{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"type": "object",
	"properties": {
		"CreditAmount": {
			"type": "number"
		}
	},
	"required": [
		"CreditAmount"
	]
}

API

<api xmlns="http://ws.apache.org/ns/synapse" name="testAPI" context="/test" version="1" version-type="context">
   <resource methods="POST GET">
      <inSequence>
         <jsontransform schema="conf:/Lyse045_json_schema_lines.json">
         </jsontransform>
         <respond/>
      </inSequence>
   </resource>
</api>

Request Payload

{
 "CreditAmount": 10233780.57,
}

Output

{
    "CreditAmount": 1.023378057E7
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant