[ardoJSON] Unsupported type: OutSystems.HubEdition.RuntimePlatform.Db.BasicTypeList

[ardoJSON] Unsupported type: OutSystems.HubEdition.RuntimePlatform.Db.BasicTypeList

  
Forge Component
(20)
Published on 30 Aug (4 weeks ago) by Ricardo Silva
20 votes
Published on 30 Aug (4 weeks ago) by Ricardo Silva
I am getting errors from the Outsystems2JSON action in some cases.

The full error message looks like this:

Unsupported type: OutSystems.HubEdition.RuntimePlatform.Db.BasicTypeList`1[System.String]. Use the JsonSerializer class to get the object's JSON representation. Path '[0]'.

Stack trace:

Unsupported type: OutSystems.HubEdition.RuntimePlatform.Db.BasicTypeList`1[System.String]. Use the JsonSerializer class to get the object's JSON representation. Path '[0]'.
   at Newtonsoft.Json.JsonWriter.WriteValue(JsonWriter writer, PrimitiveTypeCode typeCode, Object value)
   at OutSystems.NssardoJSON.CssardoJSON.writeValue(JsonWriter json, Type type, Object val, Int32 dateFormat)
   at OutSystems.NssardoJSON.CssardoJSON.writeRecord(JsonWriter json, Object rec, Int32 dateFormat)
   at OutSystems.NssardoJSON.CssardoJSON.writeValue(JsonWriter json, Type type, Object val, Int32 dateFormat)
   at OutSystems.NssardoJSON.CssardoJSON.MssOutSystems2JSON(Object ssValue, Int32 ssDateFormat, String& ssJSON)
   at ssW_Zendesk_CS.RssExtensionardoJSON.MssOutSystems2JSON(HeContext heContext, Object inParamValue, Int32 inParamDateFormat, String& outParamJSON)

Unfortunately I don't have an example of the JSON that it is failing on because the Outsystem2JSON action is what I use to then log the outputted JSON. :\

This error is occurring inside the 'OnBeforeRequest' action of my consumed REST API. I've attached a screenshot of the assignment where this fails.

I realize this probably isn't enough information to diagnose, but if anyone else has seen this or has any ideas where I can look for more information or why it may be occurring I'd greatly appreciate it!
Note:
 
We were on version 1.7.2 until a few moments ago, I just upgraded us to v1.9.0.
 
I've also attached the OML where this is happening.
Does this happen for all requests ? Or it happens sporadically ?
This does not happen for all requests. Unfortunately I haven't been able to debug the issue yet as I'm not sure under what circumstances this happens. I will continue to try however.
Ricardo,

Do you know in what cases the 'BasicTypeList' JSON type would be passed to the WriteValue method of JSON.NET? Based on what the source code looks like for WriteValue() and the error, this type is simply not supported.

If you have any likely cases where this would be passed or an example of what that would look like, it may help me find when I am getting this error.

Thanks for your help!
BasicTypeList's should fall in the IOSList category and not be called directly to JsonWriter.WriteValue .

However, you seem to be using ardoJSON to log calls to a REST Web Service. Did you know that REST Web Services already have a logging capability? You can set their logging to "Full" to log all requests and to "Troubleshooting" to log only errors.

Perhaps instead of chasing after a sporadic error, you could simply use the platform's functionality for what you're doing?
Also I should note that the Customized Request structure does not have any nested BasicTypeList, so it's very weird that this is coming up.
Ricardo,

I did not know about that piece of functionality, I will remove my manual logging and enable that feature to let the platform do it for me. Thanks.

Only thing is that the error occurs on the assign of the Session.ZendeskRequest variable, which is before the request is attempted. So I'll still get the exception thrown before the platform is able to log the attempting request.

Just checked if this would be possible in the OnAfterResponse action and I only get the response object so I wouldn't be able to set the session variable to use for my integration logging.
What I'm going to do is add an exception handler that logs all the details that I can from the CustomizedRequest object and then throw another exception to keep the flow the same.