How to reuse structure in REST consume?

How to reuse structure in REST consume?

  

Is is possible?

I have common back end objects such as entities and structures on 1 module. Another logic for exposing webservice on another module. And UI module which call that exposed REST so I consume REST from UI module. So is it possible using manage dependencies to reuse structures on another module?

Solution

Hi Eric,

If you consume a REST API, by default the Platform creates new structures for you, unless it decides you already have a matching structure. But you can change the structure used (Data Type):

Solution

Thanks I didn't notice that....I must put body in response, structure will generate automatically. Previously if I didn't put body response I thought I must inherit/reuse the structure.

Yes, just copy/paste the body and you're set. It will reuse structures when they look similar enough (which can be annoying sometimes, but most of the time it's useful). But if you have structures you want to reference you can do that to, just delete the automaticly created structures and point to your own.