Bug: consume REST web service

Bug: consume REST web service

  
How to reproduce this bug

1) Select HTTP POST, enter the endpoint url, the request and response etc and publish your eSpace.
(Everything will be ok here!)

However if you....
i) attempt to change the method's request or response JSON content, this will not rebuild the structure!!!! 
ii) modify the structure, the new structure will be completely ignored! your json request is not going to get updated

Your app will always use the inital structure generated by the JSON content, no matter what you do, so you have to delete it and add it again to update it.

Anyone else experience this issue?
Hi Robert,

i) Can you give an example of what changes you are doing to the request/response examples? The correct behavior (as detailed in the Help) is that the examples only incrementally modify the structures to allow that on services that only reply with partial reponses (example not sending null values) or to similar structures to be reused between methods.
If an example becomes "too different" then a new structure will be created.

Note: also just to be clear here, fields with "null" or [] are not considered for the structure generation since the types can't even be guessed and a wrong guess would cause serialization/deserialization errors.


ii) The examples in the window are just one-way, even though you have the liberty to modify the structures (not read-only since there is not really a "contract"), changes there wont affect the examples you give on the window. Only the other way around.

Regards,
João Rosado

João Rosado wrote:
Hi Robert,

i) Can you give an example of what changes you are doing to the request/response examples? The correct behavior (as detailed in the Help) is that the examples only incrementally modify the structures to allow that on services that only reply with partial reponses (example not sending null values) or to similar structures to be reused between methods.
If an example becomes "too different" then a new structure will be created.
 
As indicated above the Issue is... any changes you make in the json request or response input will be ignored; change an attribute name? its be ignored, change an attribute data type? it be ignored, add a new attribute? it be ignored. No changes are reflected.

You can check this by changing the json request input, then add a break point just before the request is sent to the web service host. You will find that all your changes are ignored, you will get the original input, thats a problem!

Why would you want to change the json example? well sometimes your json example excludes error messages, so you later add example error messages, but none of your changes are reflected. 

"ii) The examples in the window are just one-way, even though you have the liberty to modify the structures (not read-only since there is not really a "contract"), changes there wont affect the examples you give on the window. Only the other way around."

Could you please clarify - "Only the other way around"? do you mean if you change the structure it will change the request or response json structure?  





 
Hello Robert,

You have opened a support case about this and I have answered it.

Basically, my tests on Service Studio support João Rosado's view. If I make significant changes to the JSON example, those changes are reflected in the generated structures.

If you are indeed not seeing this, we would like to get your example JSONs so we can further analyse the issue and follow up, as that would be a bug.

Please follow up on this thread in the support case, and at the end we can share any findings from there here.

Best regards,
Ricardo Silva
Ricardo Silva wrote:
Hello Robert,

You have opened a support case about this and I have answered it.

Basically, my tests on Service Studio support João Rosado's view. If I make significant changes to the JSON example, those changes are reflected in the generated structures.

If you are indeed not seeing this, we would like to get your example JSONs so we can further analyse the issue and follow up, as that would be a bug.

Please follow up on this thread in the support case, and at the end we can share any findings from there here.

Best regards,
Ricardo Silva
Ricardo

I checked this again and again I was able to reproduce the following bugs
1) When I change the json attribute name, what happens is 3 things
i) the attribute name gets appended to the bottom of structure (old attribute name still exist - unexpected behaviour) 
ii) the attribute name actually updates the structure name (expected behaviour)
iii) An entire new structures is created with your changes (unexpected behaviour) 

2) When the attribute names are changed, the changes are not sent to the web service host
(I'm unable to reproduce this bug right now! further testing required

This issue might have been occured because new structures was created, but I was unaware about the new structures that were created and as such the call was made using the "old" structures, - would switching the code to the new structures reflect the changes? this has not been tested!)

3) Changing the data type in the json content body will not update the structure
(confirmed)
This bug verified and confirmed by outsystems. (case-831801-387912C)

No further testing required.