pyeve / eve-swagger

Swagger extension for Eve-powered RESTful APIs
http://python-eve.org
Other
154 stars 43 forks source link

Fix urlprefix #91

Closed rmlopes closed 5 years ago

rmlopes commented 5 years ago

The URL_PREFIX is not respected on this extension. Should be something as simple as providing it when registering the blueprint:

app.register_blueprint(swagger, url_prefix="/%s" % app.config["URL_PREFIX"])

However this does not work as intended (not sure why). So, I propose changing the extension to be able to provide the url_prefix at the blueprint creation statement. Alternative suggestions are welcome. `

nicolaiarocci commented 5 years ago

Hi, URL_PREFIX support has been added with https://github.com/pyeve/eve-swagger/pull/86 - have you checked it out yet? I admit I've been slow, a new release should be out soon.

rmlopes commented 5 years ago

Hi @nicolaiarocci, I synced with upstream before implementing this fix. The patch in #86 does not cover what I propose here. It adds support to include the URL_PREFIX in the server name, however the endpoint where the docs are served does not include it, it remains at api-docs. This is a problem if you are using virtual paths at the same domain name for several services, hence I propose here to change the blueprint creation to a factory method.

nicolaiarocci commented 5 years ago

got it. can you please rebase on top of master, and squash into one single commit?

rmlopes commented 5 years ago

Ok, I think I've managed to properly clean the commit history. It was a handful because eve though my fork was synced the history was completely divergent. Should be ready to merge.

nicolaiarocci commented 5 years ago

thanks