E-IB: PT 8.53 Document.GenJsonString() Generates Unexpected Trailing Comma for Empty Collection Making Subsequent JSON String Parsing to Fail (Doc ID 1961378.1)

Last updated on JANUARY 10, 2017

Applies to:

PeopleSoft Enterprise PT PeopleTools - Version 8.53 to 8.53 [Release 8.4]
Information in this document applies to any platform.

Symptoms

On PeopleTools 8.53.10, if a Document object has an empty collection, the string generated by GenJsonString() has an unexpected trailing comma, making its parsing to fail.

Replication Steps:
1. Create two documents, "parent" and "child" in a package.
2. Add a few fields to each of these documents.
3. Create a collection named, for example, CHILDREN in the "parent" document, and add a compound to CHILDREN based on the "child" document.
4. In a PeopleCode action, create a Document object based on the "parent" document.
5. Populate the field properties of the document but do not populate the CHILDREN collection.
6. Generate a JSON string using the GenJsonString() method.
7. Observe in the output a trailing comma after the last field of the parent document.
    In the example below, the comma is after the value "222".
    {"TEST_PARENT_DOC": { "FIELD01": "111","FIELD02": "222",} }


Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms