GiDInterface icon indicating copy to clipboard operation
GiDInterface copied to clipboard

Writing json - Force parameter as type

Open jginternational opened this issue 8 years ago • 3 comments
trafficstars

Some system must be defined to make sure that a variable is written in the json as it's desired type.

A developer should be able to write:

"name": "3",
"value": 3,
"other": 3.0

where the 3 is considered first as a string, then as an integer, and as a double.

jginternational avatar Jun 22 '17 22:06 jginternational

As long as I know Json already distinguish them in this way.

pooyan-dadvand avatar Jun 27 '17 10:06 pooyan-dadvand

Yes @pooyan-dadvand , but tcl is proudly a non-typed language, so it's always difficult to know if that 3 is an integer, a double or a string

jginternational avatar Jun 27 '17 17:06 jginternational

Now I see, where we should add the types, in XMLs? We should try to make it backward compatible as an optional attribute.

pooyan-dadvand avatar Jun 28 '17 08:06 pooyan-dadvand