2
0

v3-invites.yaml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # 由 openapi/scripts/generate.php 生成,请勿手改;补充写到 overrides/v3-invites.yaml
  2. post:
  3. summary: 用验证码换注册邀请
  4. tags:
  5. - invites
  6. operationId: post_api_v3_invites
  7. description: |-
  8. 验证码正确则返回该邮箱的 invite(已有则复用,状态重置为未使用),验证码随即作废。
  9. 验证码错误、过期或试错 5 次后返回 422(errors.code)。
  10. 实现:`V3\InviteController@store`
  11. security:
  12. - { }
  13. -
  14. bearerAuth: []
  15. requestBody:
  16. required: true
  17. content:
  18. application/json:
  19. schema:
  20. type: object
  21. properties:
  22. email:
  23. type: string
  24. description: 收到验证码的邮箱
  25. code:
  26. type: string
  27. description: '邮件里的 6 位验证码'
  28. example: '123456'
  29. required:
  30. - email
  31. - code
  32. responses:
  33. 200:
  34. description: 成功
  35. content:
  36. application/json:
  37. schema:
  38. type: object
  39. properties:
  40. data:
  41. type: object
  42. properties:
  43. id:
  44. type: string
  45. email:
  46. type: string
  47. status:
  48. type: string
  49. created_at:
  50. type: string
  51. nullable: true
  52. 201:
  53. description: '首次为该邮箱签发 invite。响应体与 200 同形;复用已有 invite 时是 200'
  54. content:
  55. application/json:
  56. schema:
  57. type: object
  58. properties:
  59. data:
  60. type: object
  61. properties:
  62. id:
  63. type: string
  64. email:
  65. type: string
  66. status:
  67. type: string
  68. created_at:
  69. type: string
  70. nullable: true
  71. 422:
  72. $ref: '../../main.yaml#/components/responses/ProblemValidation'
  73. 429:
  74. description: 请求过于频繁
  75. content:
  76. application/problem+json:
  77. schema:
  78. $ref: '../../main.yaml#/components/schemas/ProblemDetails'