How to model the representation of the REST spec in java classes?

234 Views Asked by At

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?

1

There are 1 best solutions below

0
On

You might find this post interesting : http://dalelane.co.uk/blog/?p=1871

It generates HTML file with an entry for each of a REST end-point in a specific path.