Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

036 Nov 5 Add Swagger for Role #200

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
262 changes: 262 additions & 0 deletions Servers/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1677,6 +1677,256 @@ paths:
error:
type: object

/roles:
get:
tags: [roles]
security:
- JWTAuth: []
responses:
"200":
description: list of all roles
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: ok
data:
type: array
items:
$ref: "#components/schemas/Role"
"204":
description: no content to display
content:
application/json:
type: object
properties:
message:
type: string
example: no content
data:
type: object
"500":
description: internal server error
content:
application/json:
type: object
properties:
message:
type: string
example: internal server error
error:
type: object
post:
tags: [roles]
security:
- JWTAuth: []
requestBody:
description: body of the new role
content:
application/json:
schema:
type: object
properties:
name:
type: string
example: "Admin"
description:
type: string
example: "Administrator with full access to the system."
required: true
responses:
"201":
description: created role
content:
application/json:
type: object
properties:
message:
type: string
example: created
data:
type: object
$ref: "#components/schemas/Role"
"500":
description: internal server error
content:
application/json:
type: object
properties:
message:
type: string
example: internal server error
error:
type: object
"503":
description: internal server error
content:
application/json:
type: object
properties:
message:
type: string
example: service unavailable
error:
type: object
/roles/{id}:
get:
tags: [roles]
security:
- JWTAuth: []
parameters:
- in: path
name: id
schema:
type: integer
required: true
description: id of the role
responses:
"200":
description: role
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: ok
data:
$ref: "#components/schemas/Role"
"404":
description: no content to display
content:
application/json:
type: object
properties:
message:
type: string
example: not found
data:
type: object
"500":
description: internal server error
content:
application/json:
type: object
properties:
message:
type: string
example: internal server error
error:
type: object
put:
tags: [roles]
security:
- JWTAuth: []
parameters:
- in: path
name: id
schema:
type: integer
required: true
description: id of the role
requestBody:
description: body of the new role
content:
application/json:
schema:
type: object
properties:
name:
type: string
example: "Admin"
description:
type: string
example: "Administrator with full access to the system."
required: true
responses:
"202":
description: role
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: accepted
data:
$ref: "#components/schemas/Role"
"404":
description: no content to display
content:
application/json:
type: object
properties:
message:
type: string
example: not found
data:
type: object
"500":
description: internal server error
content:
application/json:
type: object
properties:
message:
type: string
example: internal server error
error:
type: object
delete:
tags: [roles]
security:
- JWTAuth: []
parameters:
- in: path
name: id
schema:
type: integer
required: true
description: id of the role to delete
responses:
"202":
description: role
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: accepted
data:
type: boolean
example: true
"404":
description: no content to display
content:
application/json:
type: object
properties:
message:
type: string
example: not found
data:
type: object
"500":
description: internal server error
content:
application/json:
type: object
properties:
message:
type: string
example: internal server error
error:
type: object

components:
securitySchemes:
JWTAuth:
Expand Down Expand Up @@ -1841,3 +2091,15 @@ components:
required:
type: boolean
example: true
Role:
type: object
properties:
id:
type: integer
example: 1
name:
type: string
example: "Admin"
description:
type: string
example: "Administrator with full access to the system."