this topic came up a couple of times in the past: reflection.
How do you find out about a WAMP procedure arguments and return value? At run-time?
Same for WAMP topics. How do discover those?
Lately, I've been thinking about this and came up with the following experimental approach.
Here is a Markdown document that documents part of a WAMP based interface exposed by some "store application":
This document in fact is written in a WAMP-flavored Markdown style.
Which means: it contains code blocks like
which actually declare a WAMP procedure in a machine readable way.
The approach is called "literate programming": http://en.wikipedia.org/wiki/Literate_programming
It's applied to API documentation / metadata generation here.
Now, Crossbar.io trunk can read such files by configuration:
And then application components can query the API at run-time via regular WAMP RPC: see attached screenshot.
The other way this will be exposed in Crossbar is: have a Web path service of resource type "apidoc", which renders above WAMP-flavored Markdown into regular HTML with nice CSS styles applied.
I'd be interested in feedback on this.
Does it make sense? Is it useful? If it does, we should probably add a description of both the WAMP reflection API and the WAMP-flavored Markdown format to the WAMP specification.
Anway, what do you think?