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
}
Creates json schema restrictions based on the validation constraints.
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
constraint | Symfony\Component\Validator\Constraint | The validation constraint |
propertyMetadata | `ApiPlatform\Metadata\ApiProperty` | The property metadata |
bool
Made with love by
Les-Tilleuls.coop can help you design and develop your APIs and web projects, and train your teams in API Platform, Symfony, Next.js, Kubernetes and a wide range of other technologies.
Learn more