13
Views
3
Comments
Solved
SS is not creating desired structs from a REST JSON response
Question
Service Studio Version
11.10.3 (Build 36711)

I need to create an application that consumes this REST API ( https://covid19-api.vost.pt/ ) with updated data about covid-19 in Portugal , for academic purpouses. I consumed the method get_last_update and SS created the desired struct from the JSON response and I could use the Data from the response and show it on screen easily, but when I try to consume the get_full_dataset method, and use its Response, instead of the desired struct , SS created attributes for each line of values and really confusing structs, in the image you can see on the left the get_last_update method response and the structure created by SS, and on the right the same but for the get_full_dataset method.

mvp_badge
MVP
Rank: #2
Solution

Hi MP,

The problem is that this is a very bad JSON format - it seems that instead of sending an array containing the data points it sends a seperate attribute for each of the data points, the attribute name being a number. So Service Studio doesn't have much of a choice with regards to creating that structure, what sensible Attribute names could it provide you with?

Staff
Rank: #413

Hey,


The Swagger is very incomplete, the workaround is to open each method and test it, then copy the response to the body and the SS will generate the output structure.

Please use the attached module is needed, you can find there the information that you're looking for.


Regards,

demo.oml

mvp_badge
MVP
Rank: #2
Solution

Hi MP,

The problem is that this is a very bad JSON format - it seems that instead of sending an array containing the data points it sends a seperate attribute for each of the data points, the attribute name being a number. So Service Studio doesn't have much of a choice with regards to creating that structure, what sensible Attribute names could it provide you with?