post.json 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. {
  2. "operationId": "loginAsUser",
  3. "summary": "Login as this user",
  4. "tags": ["users"],
  5. "security": [
  6. {
  7. "bearerAuth": ["admin"]
  8. }
  9. ],
  10. "parameters": [
  11. {
  12. "in": "path",
  13. "name": "userID",
  14. "schema": {
  15. "type": "integer",
  16. "minimum": 1
  17. },
  18. "required": true,
  19. "description": "User ID",
  20. "example": 2
  21. }
  22. ],
  23. "responses": {
  24. "200": {
  25. "description": "200 response",
  26. "content": {
  27. "application/json": {
  28. "examples": {
  29. "default": {
  30. "value": {
  31. "token": "eyJhbGciOiJSUzI1NiIsInR...16OjT8B3NLyXg",
  32. "expires": "2020-01-31T10:56:23.239Z",
  33. "user": {
  34. "id": 1,
  35. "created_on": "2020-01-30T10:43:44.000Z",
  36. "modified_on": "2020-01-30T10:43:44.000Z",
  37. "is_disabled": false,
  38. "email": "[email protected]",
  39. "name": "John Doe",
  40. "nickname": "Jonny",
  41. "avatar": "//www.gravatar.com/avatar/3c8d73f45fd8763f827b964c76e6032a?default=mm",
  42. "roles": []
  43. }
  44. }
  45. }
  46. },
  47. "schema": {
  48. "type": "object",
  49. "description": "Login object",
  50. "required": ["expires", "token", "user"],
  51. "additionalProperties": false,
  52. "properties": {
  53. "token": {
  54. "description": "JWT Token",
  55. "type": "string",
  56. "example": "eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCJ9.ey...xaHKYr3Kk6MvkUjcC4"
  57. },
  58. "expires": {
  59. "description": "Token Expiry Timestamp",
  60. "type": "string",
  61. "example": "2020-01-30T10:43:44.000Z"
  62. },
  63. "user": {
  64. "$ref": "../../../../components/user-object.json"
  65. }
  66. }
  67. }
  68. }
  69. }
  70. }
  71. }
  72. }