53
Views
3
Comments
Solved
How to reuse structure in REST consume?
Question

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?

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
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):

2017-02-23 11-12-25
Eric Halim

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.

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

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.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.