JSON OIPA Field Mapping Rules

JSON data consists of the following types:

  • Array: ordered values, separated by commas, enclosed in square brackets.
  • Boolean: true or false
  • Number: double-precision floating point number, including exponential numbers. No octal, hexadecimal, NaN, or Infinity
  • null: empty value
  • Object: unordered key/value collection enclosed in curly braces
  • String: Unicode enclosed in double quotation marks
  • Value: a string, number, true, false, null
  • White space: used between tokens

General Rules for serializing data to JSON is as below :

  • A VARCHAR2 or CLOB value is wrapped in double quotation marks (").
  • A numeric value is converted to a JSON number. (It is not quoted.)
  • A DATE or TIMESTAMP value is converted to ISO 8601 format, and the result is enclosed in double quotation marks (").
  • A BOOLEAN PL/SQL value is converted to JSON true or false. (It is not quoted.)
  • A NULL value is converted to JSON null, regardless of the NULL data type.
OIPA Type Code OIPA Data-type JSON data type Example  Additional mapping rules
01 Date String {"dateCreated": "2014-03-01T23:46:11-05:00"}

User can enter calendar dates in regular string.

Time stamp Date will be mapped to string type  in ISO format.  RFC 3339 is a profile of ISO 8601. The main difference is notably that the International Standards Organization’s ISO 8601 allows the replacement of the T (which separates the date and time) with a space, and RFC 3339 does not allow this. If the value is empty in OIPA, JSON response will have null populated.

02 Text string {"name": "Amit'}

For PUTS and where a text is a combo in OIPA screens, to map and display it  correctly, a verification of  OptionFlag is set and then apply logic to insert this data into OIPA Option-text column.

For GET, same check is performed and but data is sent in  simple key/value pairs. If the value is empty in OIPA, JSON response will have null populated.

03 Integer Number {"price": 500} If the value is empty in OIPA, JSON response will have null populated.
04 decimal Numberor  Object  {"personHeight": 75.123} OR  "baseAmount" :{"value":"100.0","currency":"USD"} Verify if CurrencyCode is populated. If so send the data as an object , else it will be pure number format. If the value is empty in OIPA, JSON response will have null populated.
05 bigtext string   "payload": "Very big payload 100K bytes" If the value is empty in OIPA, JSON response will have null populated.