4196.yaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. openapi: 3.0.0
  2. info:
  3. title: Demo API
  4. description: First test
  5. termsOfService: 'http://demo.io/terms-of-service/'
  6. contact:
  7. name: Demo Support
  8. email: support@demo.io
  9. version: 1.0.0
  10. servers:
  11. - url: '{server}/v1'
  12. variables:
  13. server:
  14. default: https://api.demo.io
  15. description: the API endpoint
  16. paths:
  17. /session:
  18. put:
  19. summary: Returns a new authentication token
  20. tags:
  21. - session
  22. security:
  23. - basicAuth: []
  24. responses:
  25. '201':
  26. description: A session object
  27. content:
  28. application/json:
  29. schema:
  30. allOf:
  31. - type: object
  32. properties:
  33. user_id:
  34. type: string
  35. format: uuid
  36. readOnly: true
  37. example: 110e8400-e29b-11d4-a716-446655440000
  38. - $ref: '#/components/schemas/Session'
  39. '401':
  40. $ref: '#/components/responses/Unauthorized'
  41. components:
  42. securitySchemes:
  43. basicAuth:
  44. type: http
  45. scheme: basic
  46. bearerAuth:
  47. type: http
  48. scheme: bearer
  49. bearerFormat: JWT
  50. schemas:
  51. Session:
  52. required:
  53. - token
  54. properties:
  55. token:
  56. type: string
  57. readOnly: true
  58. example: >-
  59. eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.EkN-DOsnsuRjRO6BxXemmJDm3HbxrbRzXglbN2S4sOkopdU4IsDxTI8jO19W_A4K8ZPJijNLis4EZsHeY559a4DFOd50_OqgHGuERTqYZyuhtF39yxJPAjUESwxk2J5k_4zM3O-vtd1Ghyo4IbqKKSy6J9mTniYJPenn5-HIirE
  60. Error:
  61. required:
  62. - message
  63. properties:
  64. message:
  65. description: a human readable message explaining the error
  66. type: string
  67. reason:
  68. description: a functionnal key about the error
  69. type: string
  70. responses:
  71. Unauthorized:
  72. description: Not authenticated
  73. content:
  74. application/json:
  75. schema:
  76. $ref: '#/components/schemas/Error'
  77. Default:
  78. description: unexpected error
  79. content:
  80. application/json:
  81. schema:
  82. $ref: '#/components/schemas/Error'