pyramid_swagger
pyramid_swagger copied to clipboard
Do not serve schema file from absolute path in config
This would be a breaking change so something for major release.
Basicly:
instead of doing something like:
pyramid_swagger.schema_directory = schemas/live/here
We would do:
pyramid_swagger.schema_location = my_app.module
This would be more in line with what pyramid uses, besides for applications that are installed via pip providing schema directory would be problematic, my approach will work correctly if you are doing something like setup.py develop
or if you have pip install my_app
.
To get actual absolute file location from schema definitio one could do then:
schema_dir = pkg_resources.resource_filename('myapp', 'module')
pkg_resources
also has tools for directly fetching the contents of schema as string if we want that.