Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
e0b24bda
Commit
e0b24bda
authored
7 years ago
by
Megan Henning
Browse files
Options
Downloads
Patches
Plain Diff
Add range read and other info to file swagger
parent
cb3525aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
swagger/templates/file-item.yaml
+27
-7
27 additions, 7 deletions
swagger/templates/file-item.yaml
with
27 additions
and
7 deletions
swagger/templates/file-item.yaml
+
27
−
7
View file @
e0b24bda
...
...
@@ -18,11 +18,15 @@ template: |
get:
summary: Download a file.
description: |
If "ticket" is specified by empty, a download ticket will be created
If "ticket" is not specified, the file will be download
If "ticket" is specified and not empty, the file will be downloaded
Files can be downloaded directly from this endpoint with a valid "Authorization" header or via a ticket id.
To generate a ticket:
- Make a request with an empty "ticket" parameter and a valid "Authorization" header. The server will respond with a generated ticket id.
- Make another request with the received ticket id in the "ticket" parameter. A valid "Authorization" header is no longer required.
When "view" is true, [RFC7233](https://tools.ietf.org/html/rfc7233) range request headers are supported.
operationId: download_{{resource}}_file
tags:
tags:
- '{{tag}}'
produces:
- application/json
...
...
@@ -31,8 +35,24 @@ template: |
- name: ticket
in: query
type: string
description: ticket id of the file to download
description: The generated ticket id for the download, or present but empty to generate a ticket id.
- name: view
in: query
type: boolean
default: false
description: |
If true, the proper "Content-Type" header based on the file's mimetype is set on response
If false, the "Content-Type" header is set to "application/octet-stream"
- name: info
in: query
type: boolean
default: false
description: If the file is a zipfile, return a json response of zipfile member information
- name: member
in: query
type: string
description: The filename of a zipfile member to download rather than the entire file
responses:
'200':
description: ''
...
...
@@ -44,7 +64,7 @@ template: |
post:
summary: Replace a file
operationId: replace_{{resource}}_file
tags:
tags:
- '{{tag}}'
responses:
default:
...
...
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