Examples.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php declare(strict_types=1);
  2. /**
  3. * @license Apache 2.0
  4. */
  5. namespace OpenApi\Annotations;
  6. /**
  7. * @Annotation
  8. */
  9. class Examples extends AbstractAnnotation
  10. {
  11. /**
  12. * $ref See https://swagger.io/docs/specification/using-ref/
  13. *
  14. * @var string
  15. */
  16. public $ref = UNDEFINED;
  17. /**
  18. * The key into Components->examples array.
  19. *
  20. * @var string
  21. */
  22. public $example = UNDEFINED;
  23. /**
  24. * Short description for the example.
  25. *
  26. * @var string
  27. */
  28. public $summary = UNDEFINED;
  29. /**
  30. * Embedded literal example. The value field and externalValue field are
  31. * mutually exclusive. To represent examples of media types that cannot
  32. * naturally represented in JSON or YAML, use a string value to contain
  33. * the example, escaping where necessary.
  34. *
  35. * @var string
  36. */
  37. public $description = UNDEFINED;
  38. /**
  39. * Embedded literal example.
  40. * The value field and externalValue field are mutually exclusive.
  41. * To represent examples of media types that cannot naturally represented
  42. * in JSON or YAML, use a string value to contain the example, escaping
  43. * where necessary.
  44. *
  45. * @var string
  46. */
  47. public $value = UNDEFINED;
  48. /**
  49. * A URL that points to the literal example. This provides the
  50. * capability to reference examples that cannot easily be included
  51. * in JSON or YAML documents.
  52. * The value field and externalValue field are mutually exclusive.
  53. *
  54. * @var string
  55. */
  56. public $externalValue = UNDEFINED;
  57. public static $_types = [
  58. 'summary' => 'string',
  59. 'description' => 'string',
  60. 'externalValue' => 'string',
  61. ];
  62. public static $_required = ['summary'];
  63. public static $_parents = [
  64. Components::class,
  65. Parameter::class,
  66. MediaType::class,
  67. ];
  68. }