Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
cubes
api
Commits
ee3a61f19b2f
Commit
ee3a61f19b2f
authored
2 years ago
by
Arnaud Vergnet
Browse files
Options
Downloads
Patches
Plain Diff
feat: add version in url path
parent
2bd2455a4827
No related branches found
No related tags found
1 merge request
!19
feat: add version in url path
Pipeline
#135486
passed
2 years ago
Stage: lint
Stage: tests
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cubicweb_api/constants.py
+1
-1
1 addition, 1 deletion
cubicweb_api/constants.py
cubicweb_api/site_cubicweb.py
+2
-1
2 additions, 1 deletion
cubicweb_api/site_cubicweb.py
cubicweb_api/util.py
+1
-1
1 addition, 1 deletion
cubicweb_api/util.py
with
4 additions
and
3 deletions
cubicweb_api/constants.py
+
1
−
1
View file @
ee3a61f1
API_PATH_DEFAULT_PREFIX
=
"
/api
/v1
"
API_PATH_DEFAULT_PREFIX
=
"
/api
"
API_ROUTE_NAME_PREFIX
=
"
cube_api_v1_
"
DEFAULT_ROUTE_PARAMS
=
{
...
...
This diff is collapsed.
Click to expand it.
cubicweb_api/site_cubicweb.py
+
2
−
1
View file @
ee3a61f1
...
...
@@ -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
,
},
...
...
This diff is collapsed.
Click to expand it.
cubicweb_api/util.py
+
1
−
1
View file @
ee3a61f1
...
...
@@ -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
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment