Exposing rest service shouldn't accept an 'integer decimal' as an integer value

On our radar

Imagine you have a rest service exposed with an input variable (amount) which is an (long) integer value. When the requested JSON is: '{ "amount": 10.0}' it's accepted as a valid request. However, OutSystems should raise an error since the inputted JSON is a decimal value.

When you get the JSON in the OnRequest action you can even see the 10.0 value, however, it's converted to 10 and becomes a valid value for the (long) integer attribute. Would be nice if OS could identify it as a decimal value and would raise an error since a decimal value can't be inserted into a (long) integer.

It would make it easier to get to errors (testing with whole values wouldn't give an error, but when a 'real' decimal value is insert, it will break into an error).

Created on 1 Feb 2018
Comments (0)