Merge pull request #12986 from hobti01/swag

fix: Location and Paging support in swagger api
This commit is contained in:
He Weiwei 2020-09-11 10:44:29 +08:00 committed by GitHub
commit 0444bb1a92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -251,6 +251,10 @@ paths:
responses:
'201':
description: Project member created successfully.
headers:
Location:
type: string
description: The URL of the created resource
'400':
description: 'Illegal format of project member or project id is invalid, or LDAP DN is invalid.'
'401':
@ -411,6 +415,13 @@ paths:
type: array
items:
$ref: '#/definitions/User'
headers:
X-Total-Count:
description: The total count of available items
type: integer
Link:
description: Link to previous page and next page
type: string
'400':
description: Invalid user ID.
'401':
@ -435,6 +446,10 @@ paths:
responses:
'201':
description: User created successfully.
headers:
Location:
type: string
description: The URL of the created resource
'400':
description: Unsatisfied with constraints of the user creation.
'403':
@ -520,6 +535,13 @@ paths:
type: array
items:
$ref: '#/definitions/UserSearch'
headers:
X-Total-Count:
description: The total count of available items
type: integer
Link:
description: Link to previous page and next page
type: string
'500':
description: Unexpected internal errors.
'/users/{user_id}':
@ -756,6 +778,13 @@ paths:
type: array
items:
$ref: '#/definitions/ReplicationExecution'
headers:
X-Total-Count:
description: The total count of available items
type: integer
Link:
description: Link to previous page and next page
type: string
'401':
description: User need to login first.
'403':
@ -778,6 +807,10 @@ paths:
responses:
'201':
description: Success.
headers:
Location:
type: string
description: The URL of the created resource
'400':
description: Bad request.
'401':
@ -859,6 +892,18 @@ paths:
format: int64
description: The execution ID.
required: true
- name: page
in: query
type: integer
format: int32
required: false
description: The page number.
- name: page_size
in: query
type: integer
format: int32
required: false
description: The size of per page.
tags:
- Products
responses:
@ -868,6 +913,13 @@ paths:
type: array
items:
$ref: '#/definitions/ReplicationTask'
headers:
X-Total-Count:
description: The total count of available items
type: integer
Link:
description: Link to previous page and next page
type: string
'400':
description: Bad request.
'401':
@ -927,7 +979,7 @@ paths:
type: integer
format: int32
required: false
description: The page nubmer.
description: The page number.
- name: page_size
in: query
type: integer
@ -943,6 +995,13 @@ paths:
type: array
items:
$ref: '#/definitions/ReplicationPolicy'
headers:
X-Total-Count:
description: The total count of available items
type: integer
Link:
description: Link to previous page and next page
type: string
'400':
$ref: '#/responses/BadRequest'
'401':
@ -1097,7 +1156,7 @@ paths:
type: integer
format: int32
required: false
description: The page nubmer.
description: The page number.
- name: page_size
in: query
type: integer
@ -1113,6 +1172,13 @@ paths:
type: array
items:
$ref: '#/definitions/Label'
headers:
X-Total-Count:
description: The total count of available items
type: integer
Link:
description: Link to previous page and next page
type: string
'400':
description: Invalid parameters.
'401':
@ -1135,6 +1201,10 @@ paths:
responses:
'201':
description: Create successfully.
headers:
Location:
type: string
description: The URL of the created resource
'400':
description: Invalid parameters.
'401':
@ -1287,6 +1357,10 @@ paths:
responses:
'201':
description: Registry created successfully.
headers:
Location:
type: string
description: The URL of the created resource
'400':
description: Unsatisfied with constraints of the registry creation.
'401':
@ -1653,6 +1727,10 @@ paths:
responses:
'201':
description: User group created successfully.
headers:
Location:
type: string
description: The URL of the created resource
'400':
description: Invalid LDAP group DN.
'401':
@ -2142,6 +2220,18 @@ paths:
summary: Get all robot accounts of specified project
description: Get all robot accounts of specified project
parameters:
- name: page
in: query
type: integer
format: int32
required: false
description: The page number.
- name: page_size
in: query
type: integer
format: int32
required: false
description: The size of per page.
- name: project_id
in: path
type: integer
@ -2158,6 +2248,13 @@ paths:
type: array
items:
$ref: '#/definitions/RobotAccount'
headers:
X-Total-Count:
description: The total count of available items
type: integer
Link:
description: Link to previous page and next page
type: string
'400':
description: The project id is invalid.
'401':
@ -2192,6 +2289,10 @@ paths:
description: Project member created successfully.
schema:
$ref: '#/definitions/RobotAccountPostRep'
headers:
Location:
type: string
description: The URL of the created resource
'400':
description: Project id is not valid.
'401':
@ -2529,6 +2630,10 @@ paths:
responses:
'201':
description: Project webhook policy create successfully.
headers:
Location:
type: string
description: The URL of the created resource
'400':
description: Illegal format of provided ID value.
'401':
@ -2729,6 +2834,13 @@ paths:
type: array
items:
$ref: '#/definitions/WebhookJob'
headers:
X-Total-Count:
description: The total count of available items
type: integer
Link:
description: Link to previous page and next page
type: string
'400':
description: Illegal format of provided ID value.
'401':
@ -2912,6 +3024,10 @@ paths:
responses:
'201':
description: Project created successfully.
headers:
Location:
type: string
description: The URL of the created resource
'400':
description: Illegal format of provided ID value.
'401':
@ -3020,6 +3136,18 @@ paths:
format: int64
required: true
description: Retention ID.
- name: page
in: query
type: integer
format: int32
required: false
description: The page number.
- name: page_size
in: query
type: integer
format: int32
required: false
description: The size of per page.
responses:
'200':
description: Get a Retention job successfully.
@ -3028,6 +3156,13 @@ paths:
items:
type: object
$ref: '#/definitions/RetentionExecution'
headers:
X-Total-Count:
description: The total count of available items
type: integer
Link:
description: Link to previous page and next page
type: string
'401':
description: User need to log in first.
'403':
@ -3094,6 +3229,18 @@ paths:
format: int64
required: true
description: Retention execution ID.
- name: page
in: query
type: integer
format: int32
required: false
description: The page number.
- name: page_size
in: query
type: integer
format: int32
required: false
description: The size of per page.
responses:
'200':
description: Get Retention job tasks successfully.
@ -3102,6 +3249,13 @@ paths:
items:
type: object
$ref: '#/definitions/RetentionExecutionTask'
headers:
X-Total-Count:
description: The total count of available items
type: integer
Link:
description: Link to previous page and next page
type: string
'401':
description: User need to log in first.
'403':
@ -3162,6 +3316,13 @@ paths:
type: array
items:
$ref: '#/definitions/ScannerRegistration'
headers:
X-Total-Count:
description: The total count of available items
type: integer
Link:
description: Link to previous page and next page
type: string
'400':
description: Bad query paramters
'401':
@ -3170,7 +3331,19 @@ paths:
description: Request is not allowed, system role required
'500':
description: Internal server error happened
parameters:
- name: page
in: query
type: integer
format: int32
required: false
description: The page number.
- name: page_size
in: query
type: integer
format: int32
required: false
description: The size of per page.
post:
summary: Create a scanner registration
description: |
@ -3187,6 +3360,10 @@ paths:
responses:
'201':
description: Created successfully
headers:
Location:
type: string
description: The URL of the created resource
'400':
description: Bad registration request
'401':
@ -3421,6 +3598,18 @@ paths:
- Products
- Scanners
parameters:
- name: page
in: query
type: integer
format: int32
required: false
description: The page number.
- name: page_size
in: query
type: integer
format: int32
required: false
description: The size of per page.
- name: project_id
in: path
required: true
@ -3434,6 +3623,13 @@ paths:
type: array
items:
$ref: '#/definitions/ScannerRegistration'
headers:
X-Total-Count:
description: The total count of available items
type: integer
Link:
description: Link to previous page and next page
type: string
'400':
description: Bad project ID or query parameters
'401':