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