contracts/tester/v1/openapi.yaml
2025-02-25 18:26:37 +05:00

343 lines
7.4 KiB
YAML

openapi: 3.0.3
info:
title: TesterService API
version: 0.0.1
paths:
/problems:
get:
operationId: ListProblems
security:
- bearerAuth: [ ]
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ListProblemsResponse'
post:
operationId: CreateProblem
security:
- bearerAuth: [ ]
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CreateProblemResponse'
/problems/{id}:
get:
operationId: GetProblem
security:
- bearerAuth: [ ]
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int32
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetProblemResponse'
delete:
operationId: DeleteProblem
security:
- bearerAuth: [ ]
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int32
responses:
"200":
description: OK
content: { }
/contests:
get:
operationId: ListContests
security:
- bearerAuth: [ ]
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ListContestsResponse'
post:
operationId: CreateContest
security:
- bearerAuth: [ ]
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CreateContestResponse'
/contests/{id}:
get:
operationId: GetContest
security:
- bearerAuth: [ ]
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int32
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GetContestResponse'
delete:
operationId: DeleteContest
security:
- bearerAuth: [ ]
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int32
responses:
"200":
description: OK
/contests/{id}/tasks:
post:
operationId: AddTask
security:
- bearerAuth: [ ]
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int32
- name: problem_id
in: query
required: true
schema:
type: integer
format: int32
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/AddTaskResponse'
delete:
operationId: DeleteTask
security:
- bearerAuth: [ ]
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int32
- name: task_id
in: query
required: true
schema:
type: integer
format: int32
responses:
"200":
description: OK
/contests/{id}/participants:
post:
operationId: AddParticipant
security:
- bearerAuth: [ ]
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int32
- name: user_id
in: query
required: true
schema:
type: integer
format: int32
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/AddParticipantResponse'
delete:
operationId: DeleteParticipant
security:
- bearerAuth: [ ]
parameters:
- name: id
in: path
required: true
schema:
type: integer
format: int32
- name: participant_id
in: query
required: true
schema:
type: integer
format: int32
responses:
"200":
description: OK
components:
schemas:
Problem:
type: object
required:
- id
- title
- legend
- input_format
- output_format
- notes
- tutorial
- latex_summary
- time_limit
- memory_limit
- created_at
- updated_at
properties:
id:
type: integer
format: int32
title:
type: string
legend:
type: string
input_format:
type: string
output_format:
type: string
notes:
type: string
tutorial:
type: string
latex_summary:
type: string
time_limit:
type: integer
format: int32
memory_limit:
type: integer
format: int32
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
ListProblemsResponse:
type: object
required:
- problems
properties:
problems:
type: array
items:
$ref: '#/components/schemas/Problem'
CreateProblemResponse:
type: object
required:
- id
properties:
id:
type: integer
format: int32
GetProblemResponse:
type: object
required:
- problem
properties:
problem:
$ref: '#/components/schemas/Problem'
Contest:
type: object
required:
- id
- title
- created_at
- updated_at
properties:
id:
type: integer
format: int32
title:
type: string
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
ListContestsResponse:
type: object
required:
- contests
properties:
contests:
type: array
items:
$ref: '#/components/schemas/Contest'
CreateContestResponse:
type: object
required:
- id
properties:
id:
type: integer
format: int32
GetContestResponse:
type: object
required:
- contest
properties:
contest:
$ref: '#/components/schemas/Contest'
AddParticipantResponse:
type: object
required:
- id
properties:
id:
type: integer
format: int32
AddTaskResponse:
type: object
required:
- id
properties:
id:
type: integer
format: int32
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT