45
Views
1
Comments
REST API Integration Enum
Question

What is the best way of consuming a REST endpoint with enums in the response structure in an integration Library?

By default ODC creates the enums as a static, but doesn't map them in the response structure (type is set to Text).


What is the best way to wrap this REST integration into a server action?
As I would prefer not to duplicate all structure for request and response, but to simply adapt the structure to include the enum.

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

Hi Dieter,

Unfortunately, OutSystems doesn't support Identifiers inside a REST structure. But that's ok, you can always use TextToIdentifier to convert a Text attribute to an Identifier if needed (and you can compare a Text variable to an Identifier type).

As for wrapping them, it would indeed be a bit of a bother to have to convert the REST output to an almost identical structure just for the right Static Identifier, but that's probably the only recourse you have.

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