Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- openapi: 3.0.0
- info:
- description: >-
- Описание АПИ для ГПО сервера (публичное апи для веб-приложения и мобильного
- приложения)
- version: 1.0.0
- title: GPO Server
- servers:
- - url: 'http://germangorodnev.com:5000/api/v1'
- description: Главный сервер
- paths:
- /auth/register:
- post:
- tags:
- - Auth
- summary: Зарегистрировать пользователя
- description: ''
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/User'
- example:
- username: Test Username
- password: 'nwui#!w1'
- email: test@hehe.xd
- responses:
- '201':
- description: >-
- Юзер зарегистрирован, на почту отослано сообщение с ссылкой
- подтверждения
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/User'
- example:
- registered: true
- '409':
- description: Занят имейл\никнейм
- /auth/login:
- post:
- tags:
- - Auth
- summary: Логин по username\email и password
- description: ''
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/User'
- example:
- login: Test Username / hehexd@gmail.xd
- password: 'nwui#!w1'
- responses:
- '200':
- description: 'Юзер залогинен, токен в теле ответа'
- content:
- application/json:
- example:
- token: ...
- '401':
- description: 'Юзер ввел неверный пароль\логин, или не подтвердил имейл'
- content:
- application/json:
- example:
- error: invalid | emailConfirm
- /arena/task:
- get:
- tags:
- - Arena
- summary: Получить текущий таск на арене
- description: ''
- responses:
- '200':
- description: 'Таск получен'
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/Task'
- example:
- task:
- type: 'maze'
- info: ...
- answer: ...
- success: true
- '400':
- description: Юзер не на арене, или чето еще не так
- /arena/submit:
- post:
- tags:
- - Arena
- summary: Отправить задание на апрув. Отправка точно в таком же формате, как и в обычном таске в лессоне.
- description: ''
- responses:
- '200':
- description: Таск отправлен
- content:
- application/json:
- example:
- success: true
- result:
- points: 10
- questions: [{
- points: 10,
- right: true
- }]
- externalDocs:
- url: https://github.com/GermanGorodnev/gpo-server/wiki/Arena
- description: Описание арены
- components:
- securitySchemes:
- BearerAuth:
- type: http
- scheme: bearer
- bearerFormat: JWT
- schemas:
- Task:
- type: object
- properties:
- type:
- type: string
- info:
- type: object
- answer:
- type: object
- User:
- type: object
- properties:
- info:
- type: object
- properties:
- firstName:
- type: string
- firlastNamestName:
- type: string
- age:
- type: number
- about:
- type: string
- avatar:
- type: string
- auth:
- type: object
- properties:
- username:
- type: string
- password:
- type: string
- email:
- type: string
- emailConfirmed:
- type: boolean
- badges:
- type: array
- items:
- type: object
- properties:
- bid:
- type: string
- at:
- type: string
- format: date
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement