JSON Schema does this for JSON, but of course it just covers JSON objects (= simple structs). So for our purpose, we need to cover live objects with constructors and methods.
Fortunately, it's quite straight forward to extend JSON Schema accordingly:
We can just add "constructors" and "operations" fields at the same level
as "properties", model parameters below, and we are basically done.
We can just introduce a "function" type (containing the return type and
parameter types) and add "constructors" at the same levelas "properties".
I haven't written up an extended JSON Meta-Schema for this yet, but generated some examples from the HTML 5 spec already.
I don't think this is fully complete / correct yet, but I wanted to start looking into using this for actual type checking (using Esprima) before refining the format some more.
Comments or Suggestions? Use this G+-Post.