Hi all,
I've been thinking for a while whether it makes sense to add an API REST
module in Metamodel. The idea would be to have another Metamodel module
which allows the user to connect to a specific API REST and then perform
POST, GET, PUT and DELETE methods. The DataContext could be instantiated
passing the base url, for instance: http://mydomain/myapirest/ and then you
will be able to interact with the operations provided by this API REST. The
different operations provided by the API would be our Datacontext "tables",
to auto-discover the "tables" we could assume that the API REST provides a
framework (swagger[1] for instance) and then we can parse the API
documentation provided by the framework, see following an example of the
json provided by swagger:
{"apiVersion":"1.0","swaggerVersion":"1.2","apis":[{"path":"/api/users","description":"User
methods"},{"path":"/api/roles","description":"Roles methods"}]}
In order to query the "tables" we can use the GET method of the API and
then we can handle the responses (json/xml format) by creating an
on-the-fly json/xml file and using our json/xml metamodel modules to query
this response and return the results to the client.
This is just a bunch of ideas but...what do you think? Does it make any
sense for you all? Would it be useful?
[1] http://swagger.io/