I checked the "JSON Schema Service Descriptor" and found it quite
useful but limited to method definition. In general I think it doesn't
provide enough specifics as RPC description because it simply reuses
JSON Schema property definition.
So, I checked a couple of other IDLs including Apache Thrift, Google
Protocol Buffers and WADL. I found that the Thrift IDL is simple and
good enough to describe RPC description. Actually, I tried to use
ThriftIDL directly but its documentation is really poor and its
implementation was not easy to setup.
As a result, I am thinking about creating JSON based IDL that covers
all elements of Thrift and JSON-RPC. Before defining JSON schema for
this IDL, I want to give a simple example:
{
"jsonidl": "0.1",
"MathServiceInterface": {
"version": "0.1",
"context": "msi.geometry.2d",
"types": [
{ "name": "Point",
"members": [
{ "name": "x", "type": "i32" },
{ "name": "y", "type": "i32" }
]
}
],
"errors": [
["CALC_UNKNOWN", -32010, "Unknown error"],
["CALC_DIVBYZERO", -32011, "Division by zero"]
],
"services": [
{ "name": "Coordiate",
"methods": [
{ "name": "moveBy",
"params": [
{ "type": "Point", "name": "position" },
{ "type": "Point", "name": "delta" }
],
"result": { "type": "Point" }
},
{ "name": "scaleDown",
"params": [ { "type": "Point" }, { "type": "i32" } ],
"result": { "type": "Point" },
"errors": [ "CALC_DIVBYZERO" ]
}
]
}
]
}
This example alone can not tell everything that implies but please
note that this IDL is for generating programming codes and other IDLs
(such as ThriftIDL, WADL), as well as defining JSON-RPC messages. If
others are interested in this approach, I can post some updates later.
And comments are welcome always.
--
You received this message because you are subscribed to the Google Groups "JSON-RPC" group.
To post to this group, send email to
json...@googlegroups.com.
To unsubscribe from this group, send email to
json-rpc+u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/json-rpc?hl=en.