Skip to Main Content
IBM Z Software


This portal is to open public enhancement requests against IBM Z Software products. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Planned for future release
Categories EGL Language
Created by Guest
Created on Aug 15, 2023

In RBD EGL generated to Java we cannot get a top level array in JSON to convert into an object

Many RESTful services return results with a top-level array. EGL does not support converting this JSON to record. (IBM Support case TS013710542 was opened on this issue with the recommendation following from IBM that and RFE be created.)

In EGL under versions 9.6.0 and 9.7.0, generated to Java, we are not able to get the ServiceLib.convertToJSON function to convert to an object array. Here is a simple example to illustrate our need:

record Person
  firstname string;
  lastname string;
end


program TestJSON type BasicProgram(parm1 int, parm2 string) {}

  function main()

  try
    // Just a Person, no array
    person1 Person;
    json1 string = "{ \"firstname\": \"Dan\", \"lastname\": \"Darnell\" }";
    ServiceLib.convertFromJSON(json1, person1);
    SysLib.writeStdout(person1.firstname + " " + person1.lastname); 

    // A Person inside a top-level array
    person2 Person[0];
    json2 string = "[{ \"firstname\": \"Dan\", \"lastname\": \"Darnell\" }]";
    ServiceLib.convertFromJSON(json2, person2);
    SysLib.writeStdout(person2[1].firstname + " " + person2[1].lastname);

  onException(aException AnyException)
    SysLib.writeStdout(aException.messageID + " " + aException.message);
  end
  end
end
--------------------------------------------------------------
The first part, with just a Person object works fine and just as we expected it to.

The second part, where the JSON contains an array, doesn't map to our Person array.

Here is the output:
Dan Darnell
EGL1561E EGL1561E Service library JSON conversion functions operate on a Record or Dictionary. com.ads.woocommerce.Person[] is not a supported type.
EGL0002I The error occurred in TestJSON processing the main function.

Desired functionality:

The desired functionality is for the convertFromJSON function to handle top-level arrays when mapping to record parts.

 

Idea priority Medium
  • Guest
    Reply
    |
    Oct 26, 2023
    The feature that is described in this request is a candidate for a future release.

    A preliminary evaluation of this request indicates that it is consistent with our business strategy. Further evaluation of this RFE is underway.
  • Guest
    Reply
    |
    Sep 14, 2023
    A preliminary evaluation of this request indicates that it is consistent with our business strategy. Further evaluation of this RFE is underway.