Skip to content

Commit

Permalink
Merge pull request #200 from HarshP4585/036-nov-5-add-swagger-for-roles
Browse files Browse the repository at this point in the history
036 Nov 5 Add Swagger for Role
  • Loading branch information
MuhammadKhalilzadeh authored Nov 7, 2024
2 parents 7d815ce + a3970a9 commit 8866208
Showing 1 changed file with 262 additions and 1 deletion.
263 changes: 262 additions & 1 deletion Servers/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2481,6 +2481,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 @@ -2710,4 +2960,15 @@ components:
example: "Possible"
risk_level:
type: string
example: "High"
example: "High" 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."

0 comments on commit 8866208

Please sign in to comment.