generateJsonDynamic
generateJsonDynamic(source: Any): StringUtf8;
The generateJsonDynamic method of the JadeJson class generates JSON from the type Any value specified in the source parameter.
The Any value can be one of the following types.
-
JadeJsonObject
-
JadeAnyArray
-
Boolean
-
Integer
-
Real
-
StringUtf8
-
An uninitialized Any value
If the specified source parameter has a value of a different type, exception 11159 (Provided item cannot be converted to JSON) is raised.
If the specified source parameter is of type:
-
Boolean, Integer, Real, StringUtf8, or an initialized Any value, it is converted to JSON representing that value.
-
JadeJsonObject or JadeAnyArray, the method returns a JSON string representing that object or array and all of its subobjects or arrays.
If the root object or any of the JadeAnyArray arrays in the hierarchy contain a value not of the type in the above list, exception 11159 (Provided item cannot be converted to JSON) is raised and no JSON is generated. The extended error text, exception object, and error item of the exception provide additional information to help determine which object or value was invalid. (This exception is also raised if the root object is of the incorrect type.)
2022.0.04 and higher