bitfocus / companion-module-generic-osc

Companion Module
MIT License
3 stars 14 forks source link

Quote stripping breaks support for JSON data #25

Open DancingPigeon opened 1 year ago

DancingPigeon commented 1 year ago

When using the 'Send multiple arguments' action the quote stripping currently occurring on string properties makes it impossible to send JSON data as it strips out all except for the leading and ending quote characters. OSC typically supports a data argument as the final argument being stringified JSON data, but this feature won't work in Companion due to the quote stripping.

I would expect sending the following command should be supported:

[ 'VT', 2, '{"surface":"main_16x9","variables":{"abc":"123"}}' ]

However, it comes through as something like this:

[ 'VT', 2, '{surface:main_16x9,variables:{abc:123}}' ]
DancingPigeon commented 1 year ago

@JeffreyDavidsz - I've tried testing this in v2.2.0 but the result is still the same.

I've tried '{\"surface\":\"main_16x9\",\"variables\":{\"abc\":\"def\"}}' and '{"surface":"main_16x9","variables":{"abc":"def"}}' but in both cases the quotes are stripped out on the receiving end.

JeffreyDavidsz commented 1 year ago

Could you try the beta please?

DancingPigeon commented 1 year ago

Will do. Thank you.

DancingPigeon commented 1 year ago

@JeffreyDavidsz - do you mean the latest beta build of Companion? If so I'm experiencing the same result. If you mean of this plugin specifically I just need to be pointed towards where I opt into a beta build.

JeffreyDavidsz commented 1 year ago

Yes I mean the beta of Companion, you mentioned v2.2.0 .... which in most cases is the version number of Companion. But as you state you did. I believe I had this issue before in a other module. Don't remember which one yet

DancingPigeon commented 1 year ago

Ah sorry, I meant version 2.2.0 of this plugin. I have tried the latest rc and beta build of companion. Both appear to have 2.2.0 of this plugin.