diff --git a/src/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaGreaterThanRestriction.php b/src/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaGreaterThanRestriction.php index 4fc357d390a..6482cbfda8a 100644 --- a/src/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaGreaterThanRestriction.php +++ b/src/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaGreaterThanRestriction.php @@ -31,8 +31,7 @@ final class PropertySchemaGreaterThanRestriction implements PropertySchemaRestri public function create(Constraint $constraint, ApiProperty $propertyMetadata): array { return [ - 'minimum' => $constraint->value, - 'exclusiveMinimum' => true, + 'exclusiveMinimum' => $constraint->value, ]; } diff --git a/src/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaLessThanRestriction.php b/src/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaLessThanRestriction.php index c7354f9af80..0693aeee3f7 100644 --- a/src/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaLessThanRestriction.php +++ b/src/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaLessThanRestriction.php @@ -31,8 +31,7 @@ final class PropertySchemaLessThanRestriction implements PropertySchemaRestricti public function create(Constraint $constraint, ApiProperty $propertyMetadata): array { return [ - 'maximum' => $constraint->value, - 'exclusiveMaximum' => true, + 'exclusiveMaximum' => $constraint->value, ]; } diff --git a/tests/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaGreaterThanRestrictionTest.php b/tests/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaGreaterThanRestrictionTest.php index bbf45247146..73901abef57 100644 --- a/tests/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaGreaterThanRestrictionTest.php +++ b/tests/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaGreaterThanRestrictionTest.php @@ -58,8 +58,7 @@ public static function supportsProvider(): \Generator public function testCreate(): void { self::assertEquals([ - 'minimum' => 10, - 'exclusiveMinimum' => true, + 'exclusiveMinimum' => 10, ], $this->propertySchemaGreaterThanRestriction->create(new GreaterThan(['value' => 10]), (new ApiProperty())->withBuiltinTypes([new Type(Type::BUILTIN_TYPE_INT)]))); } } diff --git a/tests/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaLessThanRestrictionTest.php b/tests/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaLessThanRestrictionTest.php index 84e2c1daa64..80409cd3a5f 100644 --- a/tests/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaLessThanRestrictionTest.php +++ b/tests/Symfony/Validator/Metadata/Property/Restriction/PropertySchemaLessThanRestrictionTest.php @@ -58,8 +58,7 @@ public static function supportsProvider(): \Generator public function testCreate(): void { self::assertEquals([ - 'maximum' => 10, - 'exclusiveMaximum' => true, + 'exclusiveMaximum' => 10, ], $this->propertySchemaLessThanRestriction->create(new LessThan(['value' => 10]), (new ApiProperty())->withBuiltinTypes([new Type(Type::BUILTIN_TYPE_INT)]))); } } diff --git a/tests/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php b/tests/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php index 1a343e47054..0e47960ce3f 100644 --- a/tests/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php +++ b/tests/Symfony/Validator/Metadata/Property/ValidatorPropertyMetadataFactoryTest.php @@ -675,7 +675,7 @@ public static function provideNumericConstraintCases(): \Generator yield [ 'propertyMetadata' => (new ApiProperty())->withBuiltinTypes([new Type(Type::BUILTIN_TYPE_INT)]), 'property' => 'greaterThanMe', - 'expectedSchema' => ['minimum' => 10, 'exclusiveMinimum' => true], + 'expectedSchema' => ['exclusiveMinimum' => 10], ]; yield [ @@ -687,7 +687,7 @@ public static function provideNumericConstraintCases(): \Generator yield [ 'propertyMetadata' => (new ApiProperty())->withBuiltinTypes([new Type(Type::BUILTIN_TYPE_INT)]), 'property' => 'lessThanMe', - 'expectedSchema' => ['maximum' => 99, 'exclusiveMaximum' => true], + 'expectedSchema' => ['exclusiveMaximum' => 99], ]; yield [ @@ -699,7 +699,7 @@ public static function provideNumericConstraintCases(): \Generator yield [ 'propertyMetadata' => (new ApiProperty())->withBuiltinTypes([new Type(Type::BUILTIN_TYPE_INT)]), 'property' => 'positive', - 'expectedSchema' => ['minimum' => 0, 'exclusiveMinimum' => true], + 'expectedSchema' => ['exclusiveMinimum' => 0], ]; yield [ @@ -711,7 +711,7 @@ public static function provideNumericConstraintCases(): \Generator yield [ 'propertyMetadata' => (new ApiProperty())->withBuiltinTypes([new Type(Type::BUILTIN_TYPE_INT)]), 'property' => 'negative', - 'expectedSchema' => ['maximum' => 0, 'exclusiveMaximum' => true], + 'expectedSchema' => ['exclusiveMaximum' => 0], ]; yield [