JSON objects need more help with numbers and (some) strings - OpenEdge Development - Products Enhancements - Progress Community

 OpenEdge Development

JSON objects need more help with numbers and (some) strings

JSON does not have any numberic types other than "number". Nor does it have dates (values must be stringified).

The GetType(<property-name>) method returns a NUMBER value but that could refer to INT, INT64 or DECIMAL values. The ABL should provide more guidance on what the values could be. This may be via IsInteger()/IsINt64()/IsDecimal() methods or a GetNumericType() method that could return a flagged Enum. Some values - like 12 - could be INT, INT64 and DEC.

This functionality would help devs write less try-check code and make working with JSON easier

Comments
  • Good Idea !

  • Speaking of help with numbers, Progress should support parsing (not generating) numbers using exponential notation, since that is valid JSON.