0

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.

Community
  • 1
  • 1
Trem
  • 91
  • 6

1 Answers1

0

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.

Seralahthan
  • 182
  • 11
  • I'm actually only wanting to create one entry of the asset type with a single curl command but that single asset entry has one of it's field with multiple values displayed in a table (ie. similar to a contacts list in a form potentially having more than one contact). If you are saying it is not possible to create a list of values for one of the fields when creating a single asset instance, is it possible to create the intitial asset entry with one field value and then use a PUT to update the same asset but add an additional value to the field? – Trem Nov 06 '18 at 21:22