post.json 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. {
  2. "operationId": "enableUser2fa",
  3. "summary": "Verify code and enable 2FA",
  4. "tags": ["users"],
  5. "parameters": [
  6. {
  7. "in": "path",
  8. "name": "userID",
  9. "schema": {
  10. "type": "integer",
  11. "minimum": 1
  12. },
  13. "required": true,
  14. "description": "User ID",
  15. "example": 2
  16. }
  17. ],
  18. "requestBody": {
  19. "description": "Verification Payload",
  20. "required": true,
  21. "content": {
  22. "application/json": {
  23. "schema": {
  24. "additionalProperties": false,
  25. "properties": {
  26. "code": {
  27. "minLength": 6,
  28. "maxLength": 8,
  29. "type": "string",
  30. "example": "123456"
  31. }
  32. },
  33. "required": ["code"],
  34. "type": "object"
  35. },
  36. "example": {
  37. "code": "123456"
  38. }
  39. }
  40. }
  41. },
  42. "responses": {
  43. "200": {
  44. "content": {
  45. "application/json": {
  46. "examples": {
  47. "default": {
  48. "value": {
  49. "backup_codes": [
  50. "6CD7CB06",
  51. "495302F3",
  52. "D8037852",
  53. "A6FFC956",
  54. "BC1A1851",
  55. "A05E644F",
  56. "A406D2E8",
  57. "0AE3C522"
  58. ]
  59. }
  60. }
  61. },
  62. "schema": {
  63. "type": "object",
  64. "required": ["backup_codes"],
  65. "additionalProperties": false,
  66. "properties": {
  67. "backup_codes": {
  68. "description": "Backup codes",
  69. "example": [
  70. "6CD7CB06",
  71. "495302F3",
  72. "D8037852",
  73. "A6FFC956",
  74. "BC1A1851",
  75. "A05E644F",
  76. "A406D2E8",
  77. "0AE3C522"
  78. ],
  79. "type": "array",
  80. "items": {
  81. "type": "string",
  82. "example": "6CD7CB06"
  83. }
  84. }
  85. }
  86. }
  87. }
  88. },
  89. "description": "200 response"
  90. }
  91. }
  92. }