Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

Антропова Анна, 3530901/70201, lab4 #182

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
91 changes: 0 additions & 91 deletions README.md

This file was deleted.

277 changes: 277 additions & 0 deletions openapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
openapi: 3.0.0
info:
title: Bug Tracker
version: 1.0.0
description: "Realisation of bug tracking system server protocol"
tags:
- name: Authentication
- name: Developers
- name: Testers

paths:
/auth/register:
post:
summary: Register new user in the system
description: Choose nickname and role to use system.
tags:
- Authentication
parameters:
- in: query
name: user_id
required: true
schema:
type: integer
- in: query
name: role
required: true
schema:
type: string
enum: [dev, test]
responses:
'200':
description: Successfull registration
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message: "Registration is done"
'401':
description: Nickname is already in use
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message: "This user_id is already exist with this role"
/auth/login:
post:
summary: Log in with an existing account
tags:
- Authentication
description: Log in using your nickname.
parameters:
- in: query
name: user_id
required: true
schema:
type: integer
responses:
'200':
description: Successfull
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message: "Successfull log in"
'404':
description: User is not found
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message:
"User is not found"
/dev/bugs:
get:
summary: Get list of bugs assigned to the developer
tags:
- Developers
responses:
'200':
description: Successfull
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Bug'
example:
bug_id: 1
dev_id: 2
project_id: 1
text: Button is not active
'400':
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message:
"Something went wrong"

/dev/fix:
post:
summary: Fix the bug
tags:
- Developers
parameters:
- in: query
name: bug_id
required: true
schema:
type: integer
responses:
'200':
description: Successfull
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message:
"Bug is fixed"
'404':
description: Bug is not found
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message:
"Bug with this id is not found"
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message:
"This bug has already been fixed"

/test/add:
post:
summary: Add new bug
tags:
- Testers
parameters:
- in: query
name: bug
schema:
$ref: '#/components/schemas/Bug'
responses:
'200':
description: Successfull
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message:
"Bug was added to the system"
'404':
description: Project / developer is not found
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message:
"This project doesn't exist"

/test/bugs:
get:
summary: Get list of open bugs
tags:
- Testers
responses:
'200':
description: Successfull
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Bug'
example:
bug_id: 1
dev_id: 2
project_id: 1
text: Button is not active
'400':
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message:
"Something went wrong"

/test/verify:
post:
summary: Check the bug fix from developer
tags:
- Testers
parameters:
- in: query
name: bug_id
required: true
schema:
type: integer
- in: query
name: resolution
required: true
schema:
type: string
enum: [reopen, close]
responses:
'200':
description: Successfull
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message: Bug is confirmed
'404':
description: Bug is not found
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message: Bug is not found
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/Response'
example:
message: Bug has already been confirmed


components:
schemas:
Bug:
type: object
required:
- bug_id
- dev_id
- project_id
- text
properties:
bug_id:
type: integer
format: uuid
dev_id:
type: integer
format: uuid
project_id:
type: integer
format: uuid
text:
type: string

Response:
type: object
required:
- message
properties:
message:
type: string