I had a small Pyramid project which has grown into a much larger one.
Many Views service multiple Routes (multiple calls to `@view_config()`), typically offering a default HTML version on a "bare" url, and a JSON version with a ".json" suffix to the url.
Documenting these routes has become increasingly burdensome, and I really need to simplify it. For clarity, the docs are served by the application itself and in a structured format.
Right now I have two types of documentation, and I'd like to consolidate it into a single one.
* The original documentation was built off a Python file, `/lib/docs.py`, which just notes the routes which have JSON endpoints, gives an "about" docstring, and offers a dict about how the route functions (GET vs POST, is it self-documenting, etc).
* As the project progressed, the routes started self-documenting. Forms were moved to POST only, with GET offering structured details (instructions, required vs optional form elements, etc). Most of this is defined by just returning a dict on GET operations.
I've been trying to figure out the best ways to consolidate this. Perhaps using a custom decorator to declare and track this information into a namespace?
Has anyone else worked on a scenario like this? How did you handle it?