Guides
Tutorials
Interface PropertySchemaRestrictionsInterface.
This interface is autoconfigured with the api_platform.metadata.property_schema_restriction
tag.
It is used to generate a Resource schema using property restrictions based on the Symfony’s built-in validator. For example, the Regex constraint uses a pattern type within the JSON schema.
interface ApiPlatform\Symfony\Validator\Metadata\Property\Restriction\PropertySchemaRestrictionMetadataInterface
{
public create(Symfony\Component\Validator\Constraint $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): array
public supports(Symfony\Component\Validator\Constraint $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): bool
}
interface ApiPlatform\Symfony\Validator\Metadata\Property\Restriction\PropertySchemaRestrictionMetadataInterface
{
public create(Symfony\Component\Validator\Constraint $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): array
public supports(Symfony\Component\Validator\Constraint $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): bool
}
Creates json schema restrictions based on the validation constraints.
public create(Symfony\Component\Validator\Constraint $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): array
public create(Symfony\Component\Validator\Constraint $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): array
constraint | Symfony\Component\Validator\Constraint | The validation constraint |
propertyMetadata | ApiPlatform\Metadata\ApiProperty | The property metadata |
array
Is the constraint supported by the schema restriction?
public supports(Symfony\Component\Validator\Constraint $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): bool
public supports(Symfony\Component\Validator\Constraint $constraint, ApiPlatform\Metadata\ApiProperty $propertyMetadata): bool
constraint | Symfony\Component\Validator\Constraint | The validation constraint |
propertyMetadata | ApiPlatform\Metadata\ApiProperty | The property metadata |
bool