put.json 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. {
  2. "operationId": "updateUser",
  3. "summary": "Update a User",
  4. "tags": ["Users"],
  5. "security": [
  6. {
  7. "BearerAuth": ["users"]
  8. }
  9. ],
  10. "parameters": [
  11. {
  12. "in": "path",
  13. "name": "userID",
  14. "schema": {
  15. "oneOf": [
  16. {
  17. "type": "string",
  18. "pattern": "^me$"
  19. },
  20. {
  21. "type": "integer",
  22. "minimum": 1
  23. }
  24. ]
  25. },
  26. "required": true,
  27. "description": "User ID or 'me' for yourself",
  28. "example": 2
  29. }
  30. ],
  31. "requestBody": {
  32. "description": "User Payload",
  33. "required": true,
  34. "content": {
  35. "application/json": {
  36. "schema": {
  37. "type": "object",
  38. "additionalProperties": false,
  39. "minProperties": 1,
  40. "properties": {
  41. "name": {
  42. "$ref": "../../../components/user-object.json#/properties/name"
  43. },
  44. "nickname": {
  45. "$ref": "../../../components/user-object.json#/properties/nickname"
  46. },
  47. "email": {
  48. "$ref": "../../../components/user-object.json#/properties/email"
  49. },
  50. "roles": {
  51. "$ref": "../../../components/user-object.json#/properties/roles"
  52. },
  53. "is_disabled": {
  54. "$ref": "../../../components/user-object.json#/properties/is_disabled"
  55. }
  56. }
  57. }
  58. }
  59. }
  60. },
  61. "responses": {
  62. "200": {
  63. "description": "200 response",
  64. "content": {
  65. "application/json": {
  66. "examples": {
  67. "default": {
  68. "value": {
  69. "id": 2,
  70. "created_on": "2020-01-30T09:36:08.000Z",
  71. "modified_on": "2020-01-30T09:41:04.000Z",
  72. "is_disabled": false,
  73. "email": "[email protected]",
  74. "name": "Jamie Curnow",
  75. "nickname": "James",
  76. "avatar": "//www.gravatar.com/avatar/6193176330f8d38747f038c170ddb193?default=mm",
  77. "roles": ["admin"]
  78. }
  79. }
  80. },
  81. "schema": {
  82. "$ref": "../../../components/user-object.json"
  83. }
  84. }
  85. }
  86. }
  87. }
  88. }