JsObject.one("make", "Ford")._("model", "Mustang")._("year", 1968)
);
Schema schema = Schema.create().resultFields(new Field[]{
Field.create().key("model"), Field.create().key("year")
});
DataSchemaResult data_out = Y.DataSchemaArray().apply(schema, data_in);
Window.alert(Y.dump(data_out.results())); //data_out.results().length()+" - "+JsUtil.dumpObj(data_out, true));
//another little test, this time reading a json string contained mixed formed data
String data_in2 = "[\n"+
" {make:\"Chevrolet\",model:\"Bel Air\",year:1957},\n"+
" [\"Dodge\", \"Dart\", 1964],\n"+
" \"1968 Ford Mustang\"\n"+
"]";
Schema schema2 = Schema.create().resultFields(new Field[]{
Field.create().key("make"), Field.create().key("model"), Field.create().key("year")
});
DataSchemaResult data_out2 = Y.DataSchemaArray().apply(schema2, JsonUtils.unsafeEval(data_in2));
Window.alert(Y.dump(data_out2.results()));
}
});
}