Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.67 KB | None | 0 0
  1. openapi: 3.0.0
  2. info:
  3. description: >-
  4. Описание АПИ для ГПО сервера (публичное апи для веб-приложения и мобильного
  5. приложения)
  6. version: 1.0.0
  7. title: GPO Server
  8. servers:
  9. - url: 'http://germangorodnev.com:5000/api/v1'
  10. description: Главный сервер
  11. paths:
  12. /auth/register:
  13. post:
  14. tags:
  15. - Auth
  16. summary: Зарегистрировать пользователя
  17. description: ''
  18. requestBody:
  19. required: true
  20. content:
  21. application/json:
  22. schema:
  23. $ref: '#/components/schemas/User'
  24. example:
  25. username: Test Username
  26. password: 'nwui#!w1'
  27. email: test@hehe.xd
  28. responses:
  29. '201':
  30. description: >-
  31. Юзер зарегистрирован, на почту отослано сообщение с ссылкой
  32. подтверждения
  33. content:
  34. application/json:
  35. schema:
  36. $ref: '#/components/schemas/User'
  37. example:
  38. registered: true
  39. '409':
  40. description: Занят имейл\никнейм
  41. /auth/login:
  42. post:
  43. tags:
  44. - Auth
  45. summary: Логин по username\email и password
  46. description: ''
  47. requestBody:
  48. required: true
  49. content:
  50. application/json:
  51. schema:
  52. $ref: '#/components/schemas/User'
  53. example:
  54. login: Test Username / hehexd@gmail.xd
  55. password: 'nwui#!w1'
  56. responses:
  57. '200':
  58. description: 'Юзер залогинен, токен в теле ответа'
  59. content:
  60. application/json:
  61. example:
  62. token: ...
  63. '401':
  64. description: 'Юзер ввел неверный пароль\логин, или не подтвердил имейл'
  65. content:
  66. application/json:
  67. example:
  68. error: invalid | emailConfirm
  69. /arena/task:
  70. get:
  71. tags:
  72. - Arena
  73. summary: Получить текущий таск на арене
  74. description: ''
  75. responses:
  76. '200':
  77. description: 'Таск получен'
  78. content:
  79. application/json:
  80. schema:
  81. $ref: '#/components/schemas/Task'
  82. example:
  83. task:
  84. type: 'maze'
  85. info: ...
  86. answer: ...
  87. success: true
  88. '400':
  89. description: Юзер не на арене, или чето еще не так
  90. /arena/submit:
  91. post:
  92. tags:
  93. - Arena
  94. summary: Отправить задание на апрув. Отправка точно в таком же формате, как и в обычном таске в лессоне.
  95. description: ''
  96. responses:
  97. '200':
  98. description: Таск отправлен
  99. content:
  100. application/json:
  101. example:
  102. success: true
  103. result:
  104. points: 10
  105. questions: [{
  106. points: 10,
  107. right: true
  108. }]
  109. externalDocs:
  110. url: https://github.com/GermanGorodnev/gpo-server/wiki/Arena
  111. description: Описание арены
  112. components:
  113. securitySchemes:
  114. BearerAuth:
  115. type: http
  116. scheme: bearer
  117. bearerFormat: JWT
  118. schemas:
  119. Task:
  120. type: object
  121. properties:
  122. type:
  123. type: string
  124. info:
  125. type: object
  126. answer:
  127. type: object
  128. User:
  129. type: object
  130. properties:
  131. info:
  132. type: object
  133. properties:
  134. firstName:
  135. type: string
  136. firlastNamestName:
  137. type: string
  138. age:
  139. type: number
  140. about:
  141. type: string
  142. avatar:
  143. type: string
  144. auth:
  145. type: object
  146. properties:
  147. username:
  148. type: string
  149. password:
  150. type: string
  151. email:
  152. type: string
  153. emailConfirmed:
  154. type: boolean
  155. badges:
  156. type: array
  157. items:
  158. type: object
  159. properties:
  160. bid:
  161. type: string
  162. at:
  163. type: string
  164. format: date
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement