Product.php 608 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace UsingRefs;
  3. ?>
  4. A common scenario is to let swagger-php generate a definition based on your model class.
  5. These definitions can then be referenced with `ref="#/components/schemas/$classname"
  6. <?php
  7. /**
  8. * @OA\Schema(
  9. * description="Product model",
  10. * type="object",
  11. * title="Product model"
  12. * )
  13. */
  14. class Product {
  15. /**
  16. * The unique identifier of a product in our catalog.
  17. *
  18. * @var integer
  19. * @OA\Property(format="int64", example=1)
  20. */
  21. public $id;
  22. /**
  23. * @OA\Property(ref="#/components/schemas/product_status")
  24. */
  25. public $status;
  26. }