|
5 | 5 | * To re-generate this file run `make test` |
6 | 6 | * |
7 | 7 | * |
8 | | - * @generated SignedSource<<7fa7d1f5ae7e84bf34ab173568728f05>> |
| 8 | + * @generated SignedSource<<39430f90b530b5635008632715853853>> |
9 | 9 | */ |
10 | 10 | namespace Slack\Hack\JsonSchema\Tests\Generated; |
11 | 11 | use namespace Slack\Hack\JsonSchema; |
|
97 | 97 |
|
98 | 98 | type TObjectSchemaValidatorPropertiesInvalidMinPropertiesWithNoAdditionalProperties = dict<string, mixed>; |
99 | 99 |
|
| 100 | +type TObjectSchemaValidatorPropertiesEmptyClosedShape = shape( |
| 101 | +); |
| 102 | + |
100 | 103 | type TObjectSchemaValidator = shape( |
101 | 104 | ?'only_additional_properties' => TObjectSchemaValidatorPropertiesOnlyAdditionalProperties, |
102 | 105 | ?'only_no_additional_properties' => TObjectSchemaValidatorPropertiesOnlyNoAdditionalProperties, |
|
119 | 122 | ?'only_max_properties' => TObjectSchemaValidatorPropertiesOnlyMaxProperties, |
120 | 123 | ?'min_and_max_properties' => TObjectSchemaValidatorPropertiesMinAndMaxProperties, |
121 | 124 | ?'invalid_min_properties_with_no_additional_properties' => TObjectSchemaValidatorPropertiesInvalidMinPropertiesWithNoAdditionalProperties, |
| 125 | + ?'empty_closed_shape' => TObjectSchemaValidatorPropertiesEmptyClosedShape, |
122 | 126 | ... |
123 | 127 | ); |
124 | 128 |
|
@@ -1648,6 +1652,24 @@ public static function check( |
1648 | 1652 | } |
1649 | 1653 | } |
1650 | 1654 |
|
| 1655 | +final class ObjectSchemaValidatorPropertiesEmptyClosedShape { |
| 1656 | + |
| 1657 | + private static bool $coerce = false; |
| 1658 | + private static keyset<string> $properties = keyset[ |
| 1659 | + ]; |
| 1660 | + |
| 1661 | + public static function check( |
| 1662 | + mixed $input, |
| 1663 | + string $pointer, |
| 1664 | + ): TObjectSchemaValidatorPropertiesEmptyClosedShape { |
| 1665 | + // Hack to prevent us from having to change the params names when we are not |
| 1666 | + // using them. |
| 1667 | + $_ = $input; |
| 1668 | + $_ = $pointer; |
| 1669 | + return shape(); |
| 1670 | + } |
| 1671 | +} |
| 1672 | + |
1651 | 1673 | final class ObjectSchemaValidator |
1652 | 1674 | extends JsonSchema\BaseValidator<TObjectSchemaValidator> { |
1653 | 1675 |
|
@@ -1899,6 +1921,17 @@ public static function check( |
1899 | 1921 | } |
1900 | 1922 | } |
1901 | 1923 |
|
| 1924 | + if (\HH\Lib\C\contains_key($typed, 'empty_closed_shape')) { |
| 1925 | + try { |
| 1926 | + $output['empty_closed_shape'] = ObjectSchemaValidatorPropertiesEmptyClosedShape::check( |
| 1927 | + $typed['empty_closed_shape'], |
| 1928 | + JsonSchema\get_pointer($pointer, 'empty_closed_shape'), |
| 1929 | + ); |
| 1930 | + } catch (JsonSchema\InvalidFieldException $e) { |
| 1931 | + $errors = \HH\Lib\Vec\concat($errors, $e->errors); |
| 1932 | + } |
| 1933 | + } |
| 1934 | + |
1902 | 1935 | if (\HH\Lib\C\count($errors)) { |
1903 | 1936 | throw new JsonSchema\InvalidFieldException($pointer, $errors); |
1904 | 1937 | } |
|
0 commit comments