ThirdPartyAnnotations.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php declare(strict_types=1);
  2. namespace OpenApiFixtures;
  3. /**
  4. * @OA\Info(title="Fixture for ParserTest", version="test")
  5. * Based on the examplefrom http://framework.zend.com/manual/current/en/modules/zend.form.quick-start.html
  6. */
  7. use Zend\Form\Annotation;
  8. /**
  9. * @Annotation\Name("user")
  10. * @Annotation\Hydrator("Zend\Stdlib\Hydrator\ObjectProperty")
  11. */
  12. class ThirdPartyAnnotations
  13. {
  14. /**
  15. * @Annotation\Exclude()
  16. */
  17. public $id;
  18. /**
  19. * @Annotation\Filter({"name":"StringTrim"})
  20. * @Annotation\Validator({"name":"StringLength", "options":{"min":1, "max":25}})
  21. * @Annotation\Validator({"name":"Regex", "options":{"pattern":"/^[a-zA-Z][a-zA-Z0-9_-]{0,24}$/"}})
  22. * @Annotation\Attributes({"type":"text"})
  23. * @Annotation\Options({"label":"Username:"})
  24. */
  25. public $username;
  26. /**
  27. * @Annotation\Type("Zend\Form\Element\Email")
  28. * @Annotation\Options({"label":"Your email address:"})
  29. */
  30. public $email;
  31. /**
  32. * @OA\Get(path="api/3rd-party", @OA\Response(response="200", description="a response"))
  33. */
  34. public function methodWithOpenApiAnnotation()
  35. {
  36. }
  37. }