From afe1123dcf3508744ea372ed0b18021fc0c4dbd0 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 26 Nov 2025 10:47:27 -0600 Subject: [PATCH] contract --- .../Contracts/JsonSchema/JsonSchema.php | 51 +++++++++++++++++++ .../JsonSchema/JsonSchemaTypeFactory.php | 3 +- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 src/Illuminate/Contracts/JsonSchema/JsonSchema.php diff --git a/src/Illuminate/Contracts/JsonSchema/JsonSchema.php b/src/Illuminate/Contracts/JsonSchema/JsonSchema.php new file mode 100644 index 000000000000..9ef7fd4af9f0 --- /dev/null +++ b/src/Illuminate/Contracts/JsonSchema/JsonSchema.php @@ -0,0 +1,51 @@ +)|array $properties + * @return \Illuminate\JsonSchema\Types\ObjectType + */ + public function object(Closure|array $properties = []); + + /** + * Create a new array property instance. + * + * @return \Illuminate\JsonSchema\Types\ArrayType + */ + public function array(); + + /** + * Create a new string property instance. + * + * @return \Illuminate\JsonSchema\Types\String + */ + public function string(); + + /** + * Create a new integer property instance. + * + * @return \Illuminate\JsonSchema\Types\IntegerType + */ + public function integer(); + + /** + * Create a new number property instance. + * + * @return \Illuminate\JsonSchema\Types\NumberType + */ + public function number(); + + /** + * Create a new boolean property instance. + * + * @return \Illuminate\JsonSchema\Types\BooleanType + */ + public function boolean(); +} diff --git a/src/Illuminate/JsonSchema/JsonSchemaTypeFactory.php b/src/Illuminate/JsonSchema/JsonSchemaTypeFactory.php index 4621a0e80fd2..8729e3c31da0 100644 --- a/src/Illuminate/JsonSchema/JsonSchemaTypeFactory.php +++ b/src/Illuminate/JsonSchema/JsonSchemaTypeFactory.php @@ -3,8 +3,9 @@ namespace Illuminate\JsonSchema; use Closure; +use Illuminate\Contracts\JsonSchema\JsonSchema as JsonSchemaContract; -class JsonSchemaTypeFactory extends JsonSchema +class JsonSchemaTypeFactory extends JsonSchema implements JsonSchemaContract { /** * Create a new object schema instance.