Skip to content
Snippets Groups Projects
Commit ee3a61f19b2f authored by Arnaud Vergnet's avatar Arnaud Vergnet :sun_with_face:
Browse files

feat: add version in url path

parent 2bd2455a4827
No related branches found
No related tags found
1 merge request!19feat: add version in url path
Pipeline #135486 passed
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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment