flask-restplus
flask-restplus copied to clipboard
Clone/Alias/Redirect-to a Namespace?
I have a namespace and API like:
ns = Namespace('myNamespace')
api = Api()
api.add_namespace(ns)
I can access the namespace at 'http://localhost/myNamespace' I'd like be able to also access the namespace at 'http://localhost/mynamespace'
What is the correct way to do this? Or is this not supported? I've tried cloning the namespace and adding a url_rule/route to the api, but if those methods should work I can't determine the correct syntax.
Thanks.
Your will is against common recommendations about URL paths case-sensitivity, so you have to deal with this on your own, sorry.
According to RFC3986, URLs are “case sensitive” (except for the scheme and the host).
I am looking for an answer to more general question: how can I make a namespace accessible at more than one URL?
I want to slowly deprecate an old name of my namespace. I currently have /api/v1/old_namespace/something?param=1
. I want to keep that working, but at the same time have the same functionality available at /api/v1/new_namespace/something?param=1
.
Is that possible?