JsonSchema.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace Illuminate\Contracts\JsonSchema;
  3. use Closure;
  4. interface JsonSchema
  5. {
  6. /**
  7. * Create a new object schema instance.
  8. *
  9. * @param (Closure(JsonSchema): array<string, \Illuminate\JsonSchema\Types\Type>)|array<string, \Illuminate\JsonSchema\Types\Type> $properties
  10. * @return \Illuminate\JsonSchema\Types\ObjectType
  11. */
  12. public function object(Closure|array $properties = []);
  13. /**
  14. * Create a new array property instance.
  15. *
  16. * @return \Illuminate\JsonSchema\Types\ArrayType
  17. */
  18. public function array();
  19. /**
  20. * Create a new string property instance.
  21. *
  22. * @return \Illuminate\JsonSchema\Types\StringType
  23. */
  24. public function string();
  25. /**
  26. * Create a new integer property instance.
  27. *
  28. * @return \Illuminate\JsonSchema\Types\IntegerType
  29. */
  30. public function integer();
  31. /**
  32. * Create a new number property instance.
  33. *
  34. * @return \Illuminate\JsonSchema\Types\NumberType
  35. */
  36. public function number();
  37. /**
  38. * Create a new boolean property instance.
  39. *
  40. * @return \Illuminate\JsonSchema\Types\BooleanType
  41. */
  42. public function boolean();
  43. /**
  44. * Create a new multi-type union instance.
  45. *
  46. * @param array<int, string> $types
  47. * @return \Illuminate\JsonSchema\Types\UnionType
  48. */
  49. public function union(array $types);
  50. }