crucialfelix / API

simple Application Programming Interface framework for inter-application communication with SuperCollider
17 stars 3 forks source link

Better support for JSON, parseYAML parses an array of numbers as arrays of strings #4

Closed diegovdc closed 5 years ago

diegovdc commented 5 years ago

I see that JSON.parse is simply a call to .parseYAML, however that method fails to type correctly things like an array of numbers.

i.e.

JSON.parse("[1,2,3]")[0].isNumber // false

Is there any chance of getting better support for this?

diegovdc commented 5 years ago

I see you actually opened an issue at the Supercollider repo, with the exact same problem (https://github.com/supercollider/supercollider/issues/1154 ). Too bad there is no solution yet.

crucialfelix commented 5 years ago

Yeah, it's not something that the API quark can fix. Of course I wouldn't want to implement my own JSON parser in supercollider either.

If you can send {"items": [1, 2, 3]} then you will be fine I think.