How to generate structured JSON via API Data page

Hello,
I’ve an API Data page with Datastructure based on Virtual entity and Workflow as a Datastructure Method. Input data are in structured JSON format like this:

{
"type": "DG",
	"id": "3656453548", 
	"data": [
	{
		"time": "2024-05-07 22:11:20", 
		"value1": 30.5263, 
		"value2": 12.4213
	},
	{
		"time": "2024-05-09 22:11:20", 
		"value1": 31.5263, 
		"value2": 13.4213
	}
	],
	"config": {
		"conf1": 5, 
		"conf2": 300, 
		"conf3": 30, 
		"url1": "https://url1/api/public/1",
		"url2": "https://url2/api/public/2"
	},
	"state": {
		"state1": 6,
		"state2": 3,
		"state3": 1
	}
}

Input JSON is correctly converted to XML, where the transformation takes place in the Workflow step. Then I need generate and return JSON data with similar structure as input JSON. Actually if the transformation WF step output looks like:

<?xml version="1.0" encoding="utf-8"?>
<ROOT>
  <IAPI>
    <type>DG</type>
    <success>true</success>
    <config>
      <conf1>7</conf1>
      <conf2>320</conf2>
    </config>
    <state>
      <state1>1</state1>
      <state2>4</state2>
    </state>
  </IAPI>
</ROOT>

it is merged to:

<ROOT>
  <IAPI>
    <type>DG</type>
    <success>true</success>
    <state2>4</state2>
    <conf1>7</conf1>
    <state1>1</state1>
    <conf2>320</conf2>
  </IAPI>
</ROOT>

Is there a way to model the datastructure so that the conversion to structured JSON format takes place?
Thank you.

Origam doesn’t support this type of operation. Origam data is not structured this way. To achieve this you either need to use output transformation or custom controller.

What is the use case for this type of API?

Thank you. The use case is, that the remote system has interface structured like this. We wanted to adapt to that.
Don’t you plan in your roadmap to support http JSON responses in accordance with https://jsonapi.org/? Otherwise, the usage is quite limited.

As far as I know Origam can produce such output, but with output transformation. The introduction of OmitJsonMainElement in 2024.7 should facilitate it.

Your complaints seem to be related more to the data structures and their support of this kind of data. We have no plans regarding this issue.