dynamic-reference.json 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. {
  2. "definitions": {
  3. "ExampleDefinition": {
  4. "properties": {
  5. "status": {
  6. "default": "available",
  7. "description": "The status of a product",
  8. "enum": [
  9. "available",
  10. "discontinued"
  11. ],
  12. "type": "string"
  13. }
  14. }
  15. },
  16. "Product": {
  17. "properties": {
  18. "id": {
  19. "description": "",
  20. "format": "int64",
  21. "type": "integer"
  22. },
  23. "status": {
  24. "description": "",
  25. "format": "boolean",
  26. "type": "boolean"
  27. }
  28. }
  29. }
  30. },
  31. "info": {
  32. "title": "Example of using references in swagger-php",
  33. "version": "1.0.0"
  34. },
  35. "paths": {
  36. "/api/path": {
  37. "post": {
  38. "parameters": [
  39. {
  40. "in": "body",
  41. "name": "body",
  42. "required": true,
  43. "schema": {
  44. "properties": {
  45. "description": {
  46. "type": "string"
  47. },
  48. "name": {
  49. "maximum": 64,
  50. "type": "string"
  51. }
  52. }
  53. }
  54. }
  55. ],
  56. "responses": {
  57. "200": {
  58. "description": "Example extended response",
  59. "schema": {
  60. "properties": {
  61. "data": {
  62. "$ref": "#/definitions/Product"
  63. },
  64. "errors": {
  65. "type": "object"
  66. },
  67. "status": {
  68. "default": "available",
  69. "description": "The status of a product",
  70. "enum": [
  71. "available",
  72. "discontinued"
  73. ],
  74. "type": "string"
  75. },
  76. "success": {
  77. "type": "boolean"
  78. },
  79. "token": {
  80. "type": "string"
  81. }
  82. }
  83. }
  84. }
  85. },
  86. "security": [
  87. {
  88. "Bearer": []
  89. }
  90. ],
  91. "summary": "Post to URL"
  92. }
  93. }
  94. },
  95. "responses": {
  96. "Json": {
  97. "description": "the basic response",
  98. "schema": {
  99. "properties": {
  100. "data": {},
  101. "errors": {
  102. "type": "object"
  103. },
  104. "status": {
  105. "default": "available",
  106. "description": "The status of a product",
  107. "enum": [
  108. "available",
  109. "discontinued"
  110. ],
  111. "type": "string"
  112. },
  113. "success": {
  114. "type": "boolean"
  115. },
  116. "token": {
  117. "type": "string"
  118. }
  119. }
  120. }
  121. }
  122. },
  123. "swagger": "2.0"
  124. }