186
Views
2
Comments
Solved
Dynamic structures from JSON

Hi guys, 

I am passing an API response which is JSON text to a new extension I am working on, But that response can be different in multiple scenarios.

Do you know if I can create a dynamic structure in OS? If my structure can contain only the attributes that come from the API?


Thank you

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution
2021-03-05 13-56-11
Ricardo Pereira
 
MVP

Hi,

I think that the links provided by Daniel can give you the main answer about that kind of 'dynamic'.

But can't you define a structure that covers all your cases and not send the default values? In that case the JSON can be smaller, since only JSON fields with values will be send.

Hope this can help you.


Best regards,

Ricardo

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