JSON doesn't parse anonymous object lists.
MajsterTynek opened this issue ยท 2 comments
require 'json' . parse ( '[{"foo":123},{"bar":456},{"baz":789}]' )
found this out byt rying to parse response from
Mojang API (Playernames -> UUIDs; endpoint)
@ArowShot I have found fix for this issue!
library.set("parse", new OneArgFunction() {
@Override
public LuaValue call(LuaValue arg) {
String json = arg.checkjstring();
JsonElement jsonElement = new JsonParser().parse(json);
return toLua(jsonElement);
}
});