post.json 2.1 KB

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