Open LIvvieLynn opened 3 years ago
I'm having the same problem. In fact, the problem is coming from JavaScript converting object numeric keys to string.
This shouldn't be a limitation of the library since marshalling and unmarshalling values always requires a signature that will indicate the keys are numeric. So the solution would be to parse strings for numeric signature types like you said. It shouldn't be a hard fix. Any help on this would be appreciated.
well, I see marshallers.js has checkInteger if (typeof data !== 'number') we can try to parse int it instead of throwing exception. perhaps return something back. in the 'q' switch case, we should convert data to int in case the check function fail.
Yeah that would be good.
There appears to currently be no way to use a numeric key for a dict variant.
I'm trying to add BlueZ manufacture data which requires the signature "a{qay}". E.g. {0xFFFF, [0x70, 0x74]}
When attempting to pass a variant of {0xFFFF, [0x70, 0x74]}, dbus-next converts it to { '65535': [ 112, 116 ] }. Where Object.keys converts 0xFFF to a string '65535'. Is there anyway to allow non-string keys for dict entries? (Possibly parsing strings for numeric signature types or allowing arrays in addition to objects. e.g. [[Key,Value],[Key,[Key,Value]]] for {Key:Value, Key:{Key:Value}}.)
Thanks