flask-restplus icon indicating copy to clipboard operation
flask-restplus copied to clipboard

Clone/Alias/Redirect-to a Namespace?

Open proximous opened this issue 7 years ago • 2 comments

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.

proximous avatar Jun 30 '17 03:06 proximous

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).

frol avatar Jul 21 '17 12:07 frol

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?

michcio1234 avatar May 10 '22 13:05 michcio1234