Hi, why device tags are mapped as array instead of string?
For example, when using the device get node and marking “Return tags as an object map instead of an array” option, the tags turn into something like:
It’s kinda weird to access the tags using, for example, machine.tags.foo instead of just machine.tags.foo
I agree, it is weird. The reason is because devices – unlike any other resource in Losant – supports multiple values per tag key. Therefore we have to return an array of results for each tag key, even if there is only one value, to maintain a consistent shape.
Thank you for clarifying this question, Dylan.