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
fd9c3894
Commit
fd9c3894
authored
Dec 16, 2019
by
Giorgenes Gelatti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename package api fields
Rename fields `details` and `destroy` in the _link section on the package api
parent
e1c44cbc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
16 deletions
+16
-16
doc/api/packages.md
doc/api/packages.md
+10
-10
ee/lib/ee/api/entities.rb
ee/lib/ee/api/entities.rb
+3
-3
ee/spec/fixtures/api/schemas/public_api/v4/packages/package.json
.../fixtures/api/schemas/public_api/v4/packages/package.json
+1
-1
ee/spec/requests/api/project_packages_spec.rb
ee/spec/requests/api/project_packages_spec.rb
+2
-2
No files found.
doc/api/packages.md
View file @
fd9c3894
...
...
@@ -74,8 +74,8 @@ Example response:
"version"
:
"1.0-SNAPSHOT"
,
"package_type"
:
"maven"
,
"_links"
:
{
"
details
"
:
"/namespace1/project1/-/packages/1"
,
"de
stroy
"
:
"/namespace1/project1/-/packages/1"
"
web_path
"
:
"/namespace1/project1/-/packages/1"
,
"de
lete_api_path
"
:
"/namespace1/project1/-/packages/1"
}
},
{
...
...
@@ -84,8 +84,8 @@ Example response:
"version"
:
"1.0.3"
,
"package_type"
:
"npm"
,
"_links"
:
{
"
details"
:
"/namespace1/project1/-/packages/2
"
,
"de
stroy"
:
"/namespace1/project1/-/packages/2
"
"
web_path"
:
"/namespace1/project1/-/packages/1
"
,
"de
lete_api_path"
:
"/namespace1/project1/-/packages/1
"
}
}
]
...
...
@@ -95,8 +95,8 @@ By default, the `GET` request will return 20 results, since the API is [paginate
The
`_links`
object contains the following properties:
-
`
details`
: URL to fetch details about
the package.
-
`de
stroy`
: URL to destroy
the package. Only available if the request user has permission to do so.
-
`
web_path`
: The path which you can visit in GitLab and see the details of
the package.
-
`de
lete_api_path`
: The API path to delete
the package. Only available if the request user has permission to do so.
## Get a project package
...
...
@@ -126,16 +126,16 @@ Example response:
"version"
:
"1.0-SNAPSHOT"
,
"package_type"
:
"maven"
,
"_links"
:
{
"
details
"
:
"/namespace1/project1/-/packages/1"
,
"de
stroy
"
:
"/namespace1/project1/-/packages/1"
"
web_path
"
:
"/namespace1/project1/-/packages/1"
,
"de
lete_api_path
"
:
"/namespace1/project1/-/packages/1"
}
}
```
The
`_links`
object contains the following properties:
-
`
details`
: URL to fetch details about
the package.
-
`de
stroy`
: URL to destroy
the package. Only available if the request user has permission to do so.
-
`
web_path`
: The path which you can visit in GitLab and see the details of
the package.
-
`de
lete_api_path`
: The API path to delete
the package. Only available if the request user has permission to do so.
## List package files
...
...
ee/lib/ee/api/entities.rb
View file @
fd9c3894
...
...
@@ -860,11 +860,11 @@ module EE
expose
:package_type
expose
:_links
do
expose
:
details
do
|
package
|
expose_url
api_v4_projects_packages_path
(
package_id:
package
.
id
,
id:
package
.
project_id
)
expose
:
web_path
do
|
package
|
::
Gitlab
::
Routing
.
url_helpers
.
project_package_path
(
package
.
project
,
package
)
end
expose
:de
stroy
,
if:
can_destroy
(
:package
,
&
:project
)
do
|
package
|
expose
:de
lete_api_path
,
if:
can_destroy
(
:package
,
&
:project
)
do
|
package
|
expose_url
api_v4_projects_packages_path
(
package_id:
package
.
id
,
id:
package
.
project_id
)
end
end
...
...
ee/spec/fixtures/api/schemas/public_api/v4/packages/package.json
View file @
fd9c3894
...
...
@@ -19,7 +19,7 @@
"_links"
:
{
"type"
:
"object"
,
"required"
:
[
"
details
"
"
web_path
"
],
"properties"
:
{
"details"
:
{
...
...
ee/spec/requests/api/project_packages_spec.rb
View file @
fd9c3894
...
...
@@ -77,7 +77,7 @@ describe API::ProjectPackages do
it
'returns no destroy url'
do
subject
expect
(
json_response
[
'_links'
]).
not_to
include
(
'de
stroy
'
)
expect
(
json_response
[
'_links'
]).
not_to
include
(
'de
lete_api_path
'
)
end
end
...
...
@@ -85,7 +85,7 @@ describe API::ProjectPackages do
it
'returns destroy url'
do
subject
expect
(
json_response
[
'_links'
][
'de
stroy
'
]).
to
be_present
expect
(
json_response
[
'_links'
][
'de
lete_api_path
'
]).
to
be_present
end
end
...
...
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