User bio
404 bio not found
Member since Nov 24, 2017
Posts:
Replies:
Thomas Noitz · Jul 10, 2020 go to post

Hi Robert,

I've already testet your fix with my code.

It works just fine in Caché, even without the customized datatype classes - thanks! yes

Regards, Thomas

Thomas Noitz · Jul 9, 2020 go to post

Seems like the JSONTYPE as Property-Parameter is only available in IRIS.

Therefore I've now implemented the solution suggested by @Timothy Leavitt with own datatype-classes using the JSONTYPE class-paramter. So far it seems to work.

Hope we could upgrade to IRIS anytime soon. But unfortunately we are not quite there yet.

Thanks!

Thomas

Thomas Noitz · Jul 8, 2020 go to post

I've adapted your simple example:

Class test.TestJSONExport Extends (%RegisteredObject, %ZJSON.Adaptor){Property int As %Integer;Property bool As %Boolean;Property str As %String(MAXLEN = "");ClassMethod test(){
    set obj = ..%New()
    set obj.bool=1
    set obj.int=12
    set obj.str="TEST"
    set sc = obj.%JSONExport()}}

With this I get the following terminal-output:

do ##class(test.TestJSONExport).test()
{"int":"12","bool":"true","str":"TEST"}

Is it because I'm using the backported %ZJSON from Robert in Caché?

https://community.intersystems.com/post/backport-json-cach%C3%A9
 

Thanks!

Thomas

Certifications & Credly badges:
Thomas has no Certifications & Credly badges yet.
Followers:
Thomas has no followers yet.
Following:
Thomas has not followed anybody yet.