diff --git a/tester/v1/openapi.yaml b/tester/v1/openapi.yaml index f59f513..30e3efb 100644 --- a/tester/v1/openapi.yaml +++ b/tester/v1/openapi.yaml @@ -113,7 +113,7 @@ paths: example: 3 requestBody: required: true - content: + content: application/json: schema: $ref: '#/components/schemas/UploadProblemRequest' @@ -218,7 +218,7 @@ paths: description: OK /tasks: post: - operationId: AddTask + operationId: CreateTask security: - bearerAuth: [ ] parameters: @@ -242,7 +242,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AddTaskResponse' + $ref: '#/components/schemas/CreateTaskResponse' /tasks/{id}: get: operationId: GetTask @@ -313,7 +313,7 @@ paths: schema: $ref: '#/components/schemas/ListParticipantsResponse' post: - operationId: AddParticipant + operationId: CreateParticipant security: - bearerAuth: [ ] parameters: @@ -337,7 +337,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AddParticipantResponse' + $ref: '#/components/schemas/CreateParticipantResponse' delete: operationId: DeleteParticipant security: @@ -509,6 +509,159 @@ paths: application/json: schema: $ref: '#/components/schemas/GetMonitorResponse' + /auth/terminate: + post: + operationId: Terminate + security: + - bearerAuth: [ ] + responses: + "200": + description: OK + content: { } + /auth/login: + post: + operationId: Login + security: + - BasicAuth: [ ] + responses: + "200": + description: OK + content: { } + "404": + description: Not Found + content: { } + /auth/logout: + post: + operationId: Logout + security: + - bearerAuth: [ ] + responses: + "200": + description: OK + content: { } + /auth/refresh: + post: + operationId: Refresh + security: + - bearerAuth: [ ] + responses: + "200": + description: OK + content: { } + /auth/sessions: + get: + operationId: ListSessions + security: + - bearerAuth: [ ] + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListSessionsResponse' + /users: + post: + operationId: CreateUser + security: + - bearerAuth: [ ] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateUserRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CreateUserResponse' + get: + operationId: ListUsers + parameters: + - name: page + in: query + required: true + schema: + type: integer + format: int32 + example: 1 + - name: pageSize + in: query + required: true + schema: + type: integer + format: int32 + example: 20 + security: + - bearerAuth: [ ] + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListUsersResponse' + /users/{id}: + get: + operationId: GetUser + security: + - bearerAuth: [ ] + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int32 + example: 2 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GetUserResponse' + delete: + operationId: DeleteUser + security: + - bearerAuth: [ ] + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int32 + example: 3 + responses: + "200": + description: OK + content: { } + patch: + operationId: UpdateUser + security: + - bearerAuth: [ ] + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int32 + example: 3 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateUserRequest' + required: true + responses: + "200": + description: OK + content: { } components: schemas: Pagination: @@ -775,8 +928,8 @@ components: task: $ref: '#/components/schemas/TasksListItem' solution: - $ref: '#/components/schemas/Solution' - AddParticipantResponse: + $ref: '#/components/schemas/SolutionsListItem' + CreateParticipantResponse: type: object required: - id @@ -785,7 +938,7 @@ components: type: integer format: int32 example: 1 - AddTaskResponse: + CreateTaskResponse: type: object required: - id @@ -1236,6 +1389,124 @@ components: type: array items: $ref: '#/components/schemas/SolutionsListItem' + CreateUserRequest: + type: object + required: + - username + - password + properties: + username: + type: string + example: user123 + password: + type: string + example: password123 + CreateUserResponse: + type: object + required: + - id + properties: + id: + type: integer + format: int32 + example: 13 + GetUserResponse: + type: object + required: + - user + properties: + user: + $ref: '#/components/schemas/User' + UpdateUserRequest: + type: object + properties: + username: + type: string + example: user123 + role: + type: integer + format: int32 + example: 1 + User: + type: object + required: + - id + - username + - createdAt + - modifiedAt + - role + properties: + id: + type: integer + format: int32 + example: 13 + username: + type: string + example: user123 + createdAt: + type: string + format: date-time + modifiedAt: + type: string + format: date-time + role: + type: integer + format: int32 + example: 1 + Session: + type: object + required: + - id + - userId + - role + - createdAt + - expiresAt + - userAgent + - ip + properties: + id: + type: string + userId: + type: integer + format: int32 + example: 13 + role: + type: integer + format: int32 + example: 1 + createdAt: + type: string + format: date-time + expiresAt: + type: string + format: date-time + userAgent: + type: string + example: Mozilla/5.0 + ip: + type: string + example: 154.23.50.1 + ListSessionsResponse: + type: object + required: + - sessions + properties: + sessions: + type: array + items: + $ref: '#/components/schemas/Session' + ListUsersResponse: + type: object + required: + - users + - pagination + properties: + users: + type: array + items: + $ref: '#/components/schemas/User' + pagination: + $ref: '#/components/schemas/Pagination' securitySchemes: bearerAuth: type: http