Yes, that is possible.
A good example are the Google API' s that are machine generated and fully rest.
The package also contains the code that does the actual generation.
You could adapt it to an LCL api generator since components can already be represented in JSON,