I'm not talking about using the REST
classes, like @Path
or @POST
.
I'm talking about how to translate any REST
definition into a model of classes - A model from which many things can be done, like generating client code or parsing incoming data.
A bonus might be to parse an existing Resource class and create the model for it's REST API.
Example of such class might be Resource
. A resource must have a path. A resource would have methods, like GET
or POST
. Methods would have params. And so on...
Methods can be different by definition, for example A POST
method can have a stream of data, whereas GET
cannot.
So, how to model a REST
implementation using classes?