Skip to content

Commit e6683f3

Browse files
authored
Backport JsonSchema Contract (#57939)
1 parent 54b9029 commit e6683f3

File tree

1 file changed

+51
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)