Currently, Swagger spec is generated using Flasgger. But to use Flasgger, each REST resource must have its unique class, leading to the hackish code at resourcefactory.py.
Find a better way to generate Swagger specs (maybe made an script available to compile the spec based on the models registered on the API).