Skip to content

Is there a way to create a dynamic return structure for arraylist items? #356

@tscaff

Description

@tscaff

We have come across a method implementation that we were trying to do, and need a way to determine the easiest way to return dynamic JSON data elements that are controlled by a user configurable column layout that is NOT based on repository define structures.

Since all of our returned JSON ArrayList method data is based on repository structures and it returns the nice JSON data elements for each structure element, we weren't sure if there was a way to create a dynamic ArrayList type that could have any number of elements and data types so as to support a dynamic creation of a returned list of data elements in JSON.

For Example:

commonInformation is based off of a repository structure called COMMON_INFORMATION.

This responseData arraylist would be returned based off of a user configurable column set, not off of a repository structure.

{
"commonInformation": {
"idNumber": 1,
"NetworkId": "me",
"ReturnCode": 0,
"ReturnMessage": "",
},

"responseData": [
{
"FirstName": "Bill",
"LastName": "Smith",
"AccountNumber": 123456,
},
{
"FirstName": "Bill",
"LastName": "Smith",
"AccountNumber": 123456,
} ]
}

Without a concrete definition in Harmony Core that matches it, is there any way to convert that data and create the dynamic structure, like our example in responseData?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions