I am working on defining a nested JSON object that will store a key value pair with an integer (representing the amount of something) in use case 1, and a key value pair with a string (UUID) in use case 2.
The ultimate goal is to analyze this data in future procedures.
After some consideration, I have decided to enclose the number in quotes to avoid implicit conversion. This method has been detailed in this helpful article: Can JSON numbers be quoted?
Example-1:
"kpiValue": {
"type": "Driver",
"value": 16 // => Represents the amount of something
}
Example-2
"kpiValue": {
"type": "Driver",
"value": "ident" // => The UUID is treated as a string
},
What are your thoughts on this approach?