Skip to content

feature(symfony): Add CSS Color Schema Restriction for Property Validation #7215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

SebLevDev
Copy link
Contributor

Description

This PR introduces the PropertySchemaCssColorRestriction class, which generates a regular expression (pattern) for validating CSS color values in API Platform property schemas, based on the Symfony CssColor constraint.

Technical Details

Supports multiple CSS color formats (hex, rgb, rgba, hsl, hsla, named colors, etc.).
Dynamically builds a single regex pattern combining all allowed formats, suitable for OpenAPI/JSON Schema documentation.

@SebLevDev SebLevDev force-pushed the feature/property-schema-css-color-restriction branch from 7581d75 to 89a2157 Compare June 14, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant