Thank you for your suggestion, however the error still happens.
I also didn't made it clear, but the payload doesn't have a class to be reflected from, it can be abstract, requiring it to be parsed with %DynamicObject or %DynamicArray.
Since there's no class with %Stream.* property, %ConvertJSONToObject cannot decide what to do with long strings.
The ideal would be to detect the $$$MaxStringSize size and fallback to an internal %Stream instance before assigning the value to the proxy.
Also, I'm trying to avoid using %ZEN.proxyObject due to issues with stacking many objects for a single process. So the class parameter should be something inheriting from %DynamicAbstractObject.
Here's is the step-by-step:
DEV>set f = ##class(%Stream.FileCharacter).%New()
DEV>do f.LinkToFile("/temp/lorem.json")
DEV>set sc = ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject(f,, .o)
DEV>if $System.Status.IsError(sc) do $System.OBJ.DisplayError(sc)
ERRO #5002: Erro Caché: <MAXSTRING>%ParseJSON+290^%ZEN.Auxiliary.jsonProvider.1
This won't happen if I have long strings enabled.
- Log in to post comments