Closed simo101 closed 9 years ago
Hi Simon,
Thanks for the pull request! The pull request seems fine. One question, is there a specific reason that you don't want to throw an error but rather return null? Mendix indeed allows 'null' values for most primitives, but needing to deal with this in microflows is usually cumbersome, so would just throwing and exception work as well?
What was your use case for this? Was there a Mendix rest service that delivered null values for primitives (in that case we might also skip the attribute) or are you consuming an external services that actually returns null values where you expected a number?
So I was working on integrating with Uber developers API. In the API if there is no price then it will return null. https://developer.uber.com/v1/endpoints/#price-estimates. When i was trying to call this request it would throw an error because it believed it wasn't the right type. So yes this service will return a null for a float when the low or high estimate price doesn't exist. As Mendix supports nulls I thought it would just be easiest to change this part of the code.
Fun, didn't expect such a case in the wild :). But well it is valid json, and valid in Mendix as well, so the solution seems fine. Accepted :) Thanks for contributing!
Added support for null values on integers, floats and long values