Governance REST API of WSO2 Governance Registry - POST a field array

100 Views Asked by At

I've had great success using the POST, GET and PUT Governance REST API of WSO2 Governance Registry to create basic entries in my registry, however I'm having trouble creating a field entry that has multiple rows for a single field. Creating a single entry for a particular field using the JSON request is fine. ie.

"sourceDetails_Source": "Source 1 ", "sourceDetails_SourceType": "JMS", "sourceDetails_DataDescription": "Sourced from JMS",

However when I try a POST using the following in my JSON request to create multiple lines, even though I get a '201' created code and the overall entry is generated, the actual rows for this particular field don't get created.

"sourceDetails_Source": ["Source 1","Source 2"], "sourceDetails_SourceType": ["JMS","HTTP"], "sourceDetails_DataDescription": ["Sourced from JMS","Sourced from HTTP"],

Am I using the incorrect JSON syntax? I had a look here -https://docs.wso2.com/display/Governance540/Governance+REST+API#GovernanceRESTAPI-Getalistofavailableartifacttypes but was unable to see an example. Thanks in advance.

1

There are 1 best solutions below

1
On

Currently, WSO2 Governance REST API doesn't support creating multiple registry entries at once. As in your example, you are trying to create two registry entries using multiple lines for the particular field. This is not supported, for the ease of management we treat each registry entry as a whole with the relevant fields.

So in order to create multiple registry entries, you need to execute different curl commands with payloads for each registry entry separately.