DynamicReference.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. namespace SwaggerFixtures;
  3. /**
  4. * @SWG\Info(title="Using a dynamic reference", version="unittest")
  5. */
  6. class DynamicReference
  7. {
  8. /**
  9. * @SWG\Post(
  10. * path="/api/path",
  11. * summary="Post to URL",
  12. * @SWG\Parameter(
  13. * name="body",
  14. * in="body",
  15. * required=true,
  16. * @SWG\Schema(
  17. * @SWG\Property(
  18. * property="name",
  19. * type="string",
  20. * maximum=64
  21. * ),
  22. * @SWG\Property(
  23. * property="description",
  24. * type="string"
  25. * )
  26. * )
  27. * ),
  28. * @SWG\Response(
  29. * response=200,
  30. * description="Example extended response",
  31. * ref="$/responses/Json",
  32. * @SWG\Schema(
  33. * ref="$/definitions/Product",
  34. * @SWG\Property(
  35. * property="data",
  36. * ref="#/definitions/Product"
  37. * ),
  38. * @SWG\Property(
  39. * property="test",
  40. * ref="$/definitions/TestProperty"
  41. * )
  42. * )
  43. * ),
  44. * security={{"Bearer":{}}}
  45. * )
  46. */
  47. public function postSomething()
  48. {
  49. }
  50. }
  51. /**
  52. * @SWG\Definition(
  53. * definition="Product",
  54. * @SWG\Property(
  55. * property="status",
  56. * type="string",
  57. * description="The status of a product",
  58. * enum={"available", "discontinued"},
  59. * default="available"
  60. * )
  61. * )
  62. */
  63. /**
  64. * @SWG\Definition(
  65. * definition="TestProperty",
  66. * type="string",
  67. * description="The status of a product",
  68. * enum={"available", "discontinued"},
  69. * default="available"
  70. * )
  71. */
  72. /**
  73. * @SWG\Response(
  74. * response="Json",
  75. * description="the basic response",
  76. * @SWG\Schema(
  77. * @SWG\Property(
  78. * type="boolean",
  79. * property="success"
  80. * ),
  81. * @SWG\Property(
  82. * property="data"
  83. * ),
  84. * @SWG\Property(
  85. * property="errors",
  86. * type="object"
  87. * ),
  88. * @SWG\Property(
  89. * property="token",
  90. * type="string"
  91. * )
  92. * )
  93. * )
  94. *
  95. */