Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
55357977
Commit
55357977
authored
Sep 16, 2019
by
Victor Zagorodny
Committed by
Stan Hu
Sep 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add note on expose_path helper usage to API docs
parent
4c382ecc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
doc/development/api_styleguide.md
doc/development/api_styleguide.md
+13
-0
No files found.
doc/development/api_styleguide.md
View file @
55357977
...
...
@@ -92,5 +92,18 @@ For instance:
Model
.
create
(
foo:
params
[
:foo
])
```
## Using API path helpers in GitLab Rails codebase
Because we support [installing GitLab under a relative URL], one must take this
into account when using API path helpers generated by Grape. Any such API path
helper usage must be in wrapped into the
`expose_path`
helper call.
For instance:
```
haml
-
endpoint
=
expose_path
(
api_v4_projects_issues_related_merge_requests_path
(
id:
@project
.
id
,
issue_iid:
@issue
.
iid
))
```
[
Entity
]:
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/api/entities.rb
[
validation, and coercion of the parameters
]:
https://github.com/ruby-grape/grape#parameter-validation-and-coercion
[
installing GitLab under a relative URL
]:
https://docs.gitlab.com/ee/install/relative_url.html
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment