Question
· Nov 1, 2023

set Property name

hi

we have a rest API that that on of the JSON object contain Property name "verify.facePosition"

we try to translate the JSON file to object with the function ##class(%ZEN.Auxiliary.jsonProvider).%ConvertJSONToObject()

how can we define the Property to "verify.facePosition" As %Boolean in the class ? 

i know that with underscore i can define the property with quotation marks like this - Property "verify_facePosition" As %Boolean

thanks for the help 

Product version: Caché 2016.1
Discussion (4)3
Log in or sign up to continue

Ok, using Rest Api I'm posting a request and getting an answer According to the data I posted. for example the request body looks like that:

{

"details":{

"id":"123456789",

"firstName":"bob",

"lastName":"bond",

}

}

The class Properties looks like that:

 

Property id As %Integer [ Required ];

Property firstName As  %String [ Required ];

Property lastName As  %String [ Required ];

 

And in the response I'm getting the details about this client. So far so good.

 

So now I need to send the request body like that:

{

"details":{

 

" client.id":"123456789",

"client.firstName":"bob",

"client.lastName":"bond",

}             

}

And I can't write properties with a dot:

 

Property client.id As %Integer [ Required ];

Property client.firstName As  %String [ Required ];

Property client. lastName As  %String [ Required ];

 

How can I fix this?