有没有可以从JSON模式生成JavaScript类型对象(JS函数)的库?基本上是这个的JS版本 http://code.google.com/p/jsonschema2pojo/。
谢谢。
编辑:
起点为:
{
"description": "An entity",
"type":"object",
"properties": {
"geometries": {"type": "array",
"items": {
"$ref" : "geometry"
}
}
}
}
我希望有类似这样的代码为我生成
function Entity {
this.geometries;
}
显然,模式可能会更加复杂,包括 $ref 等等,希望这能给您一个思路。