ThirdPartyAnnotations.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace SwaggerFixtures;
  3. /**
  4. * @SWG\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. use Zend\Validator\StringLength;
  9. /**
  10. * @Annotation\Name("user")
  11. * @Annotation\Hydrator("Zend\Stdlib\Hydrator\ObjectProperty")
  12. */
  13. class ThirdPartyAnnotations
  14. {
  15. /**
  16. * @Annotation\Exclude()
  17. */
  18. public $id;
  19. /**
  20. * @Annotation\Filter({"name":"StringTrim"})
  21. * @Annotation\Validator({"name":"StringLength", "options":{"min":1, "max":25}})
  22. * @Annotation\Validator({"name":"Regex", "options":{"pattern":"/^[a-zA-Z][a-zA-Z0-9_-]{0,24}$/"}})
  23. * @Annotation\Attributes({"type":"text"})
  24. * @Annotation\Options({"label":"Username:"})
  25. */
  26. public $username;
  27. /**
  28. * @Annotation\Type("Zend\Form\Element\Email")
  29. * @Annotation\Options({"label":"Your email address:"})
  30. */
  31. public $email;
  32. /**
  33. * @SWG\Get(path="api/3rd-party", @SWG\Response(response="200", description="a response"))
  34. */
  35. public function methodWithSwaggerAnnotation()
  36. {
  37. }
  38. }