Hi there,
I am creating an API using roda. On its root point I would like to send a JSON containing a list of the verbs and the paths they admit - in order to facilitate discovery and documentation.
It would look similar to this:
{ "GET" : ["/", "/users", "/users/:id"], "POST": ["/users"], "PATCH": ["/users/:id"] }
In order to generate such json, I would like to "parse the structure of the Roda tree".
I have tried reading Roda's code, and I am not able to deduce how to do so from it. I was expecting some sort of tree-related names (child, parent - you know). But it seems that either this structure either does not exist, or is implicit (via closures and such), or I just missed it.
Is there a plugin or test which does such parsing, and I can use as an example? If not, could someone please suggest an implementation (something which puts values in the console is enough).
Thanks a lot
Enrique