aiohttp-swagger
aiohttp-swagger copied to clipboard
Add setup_swagger(path_prefix) parameter
The param should be used as prefix to yaml definitions.
Now swagger_path accepts either absolute path or relative to current directory.
The parameter will allow to use relative to prefix paths.
Moreover, we could add loader concept like Jinja2 loaders -- I believe it makes sense.
Use of path_prefix could be good idea, but initially I choose this approach thinking in simplicity.
You're right that in the swagger_path is missing the consideration of relative / absolute paths. I'll take a look.
Thinking on simplicity I'm inclining to adding loaders.
If no loader is specified by setup_swagger call the path is just a path (relative to current folder or absolute).
But if the loader is specified the path is not file path but a parameter for loader. It could be relative path or just a name if dict -- it depends on loader which accepts the parameter. Just like jinja2 does.
We'll keep basic usage simple but allow to use very complex ways for yaml spec finding.
fixed in #34