Core path does not support swagger basePath #78
Related to #69.
Flask allows configuring the
When the specs are dumped as swagger specs using
I think it is important to keep the meaningful portion of the route URL separate from the base path to maintain readable documentation. #70 was the right fix for the flask extension since the
Examples of base path in similar libraries:
After looking into the implementation, I realized that the
If anyone was using flask configured with
It might be a good idea to roll back #70 and yank the releases.
A better design would be to have the flask extension apply the
I'm discovering this and I find it a bit strange that we add the
Shouldn't we revert #70 already to not add it in the first place?
I think that's what @deckar01 means in
I guess now would be a good time. Note that this is an apispec-webframeworks issue, rather than an apispec issue.
Back to apispec, I'm not sure about
What about replacing it with this (untested) ?
def normalize_path(path): if path and 'basePath' in self.options: path.lstrip(self.options['basePath']) if not path.starstwith('/'): path = '/' + path return path
I think we should do the Flask plugin change (undo #70) in apispec-webframeworks. And document the need for the user to specify the base path (how to do it differs between OpenAPI v2 and v3).
I can only talk about Flask, but from my experience, the app doesn't know its base path until told via a parameter (
Ultimately, OpenAPI v3 breaks the whole thing by allowing multiple base paths...
From there, I lean towards removing