Adding user endpoints to swagger.

This commit is contained in:
David Jay
2016-12-21 12:01:37 -08:00
parent 8f877b87cb
commit 00cf81563e
+78 -1
View File
@@ -522,7 +522,84 @@ paths:
in: query
type: number
description: The number of search restults per page.
responses:
200:
parameters:
result:
type: array
description: Users matching search criteria.
items:
$ref: '#/definitions/User'
limit:
type: number
description: Results per page.
count:
type: number
description: Total number of results.
page:
type: number
description: The current page.
totalPages:
type: number
description: The total number of pages.
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/users/:user_id/role:
post:
user_id:
in: path
type: string
format: uuid
description: ID of the user to be updated.
body:
in: body
type: object
parameters:
role:
type: string
description: Role to be added to the user.
enum:
admin
moderator
responses:
204:
description: Role update successful.
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
/users/:user_id/status:
post:
user_id:
in: path
type: string
format: uuid
required: true
description: ID of the user to be updated.
body:
in: body
type: object
parameters:
status:
type: string
required: true
description: Status for the user to be set to.
enum:
active
banned
comment_id:
type: string
format: uuid
description: The id of the comment which triggered this status change.
responses:
200:
description: Status update successful.
500:
description: An error occured.
schema:
$ref: '#/definitions/Error'
definitions:
Error:
type: object