Scenario:
Your external service returns very large numbers in JSON response ( numbers larger than 9007199254740991 (2^53-1). On postman, you are able to see proper numbers in response but in Kore.ai platform, you see the numbers changed/rounded off while handling the response (say in the Service node)
Any JS code will tend to round off such numbers. Kore.ai is built primarily on NodeJS. So this technical constraint applies to Kore.ai also.
Details:
Say you have a service like below (Using python just for simplicity):
from flask import Flask,jsonify
app = Flask(__name__)
@app.route("/")
def index():
return jsonify({"entityId": 123456789012345678,"workflowId":876543210987654321})
Through postman, you should be able to see no issues in accessing this number.
But the same service may show rounded off large numbers if consumed through any JS system like Kore.ai this issue will be evident.
Workaround:
-
In case the end API cannot be changed, we recommend that our end-user developers write a wrapper on top of the service they wanted to use. That wrapper has to convert that number to a string. In the Kore.ai platform, we will use it as a string and when any external service is called using this value, then again their wrapper has to convert the string into a number if needed.
-
If there is a scope to change the third-party API, the long numbers can be avoided in such services, and string should be used. Then, there will be no such problems encountered in our platform.