Commit ee3a61f1 authored by Arnaud Vergnet's avatar Arnaud Vergnet
Browse files

feat: add version in url path

parent 2bd2455a4827
Pipeline #135486 passed with stages
in 40 seconds
API_PATH_DEFAULT_PREFIX = "/api/v1"
API_PATH_DEFAULT_PREFIX = "/api"
API_ROUTE_NAME_PREFIX = "cube_api_v1_"
DEFAULT_ROUTE_PARAMS = {
......
......@@ -22,7 +22,8 @@
{
"type": "string",
"default": API_PATH_DEFAULT_PREFIX,
"help": "prefix used for the url path",
"help": "prefix used for the url path. "
"The api version number will be added after this prefix (only v1 for now).",
"group": "api",
"level": 2,
},
......
......@@ -41,7 +41,7 @@
)
match = re.match("^/[a-zA-Z0-9-_@.&+!*(),/]{1,29}$", path_prefix)
if match:
return path_prefix.rstrip("/")
return f"{path_prefix.rstrip('/')}/v1"
else:
if len(path_prefix) > 30:
raise ConfigurationError(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment