REST Consume Structures

REST Consume Structures

Hi guys,

 I'm exposing and cosuming Rest Services and i noticed one strange behavior on structures.

 In the service exposed I have one structure composed by one structure (response) and a Record List of another structure (Bank_Info).

 The JSON that ousystems provide is:

  "Response": {
    "Sucess": true,
    "ErrorMessage": "string"
  "BankList": [
      "BANK_INFO": {
        "Country": "string",
        "BankKey": "string",
        "Name": "string",
        "BankBranch": "string",
        "Swift": "string",
        "Adrress": "string",
        "City": "string",
        "Region": "string",
        "PostOffice": "string",
        "NameAndCity": "string"
When I consume this service, using the above json the plataform generates 4 structures. The Record List of Bank_Info is now a BankLis Item from a structure that have another structure Bank_Info.

In attach one print from the exposed and consumed structures to help understand the problem...

Why they are not equal? Any ideas?

Plácido Miranda

Hi Plácido,

The reason for this is that your BankList in the Out_BankListGet is a Record List instead of a simple list. A record list can contain more than one structure (BankList could be a Record List of both BANK_INFO and another structure), so OutSystems needs to embed it in an extra layer. If you change BankList to be a BANK_INFO List instead of a BANK_INFO Record List, this indirection should disappear.

Hi Kilian,

Makes sense... Yes it works.

Thanks for the reply,
Plácido Miranda
You're welcome!