Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[RFC] New constraints for Symfony validator #28608

Copy link
Copy link
Closed
@javiereguiluz

Description

@javiereguiluz
Issue body actions

Given that Symfony's validator is based on Java's validator, I was checking the Bean Validation 2.0 standard to see if they introduced new features that we could implement too.

These are the new constraints that Symfony doesn't define yet (although you can implement them indirectly with other existing constraints):

Dates:

  • @Past
  • @PastOrPresent
  • @Future
  • @FutureOrPresent

Numbers:

  • @Positive
  • @PositiveOrZero
  • @Negative
  • @NegativeOrZero

In addition, Hibernate Validator, the only official implementation of Bean Validator 2.0, defines other constraints:

  • @CreditCardNumber (it does just the Luhn algorithm check, via the @LuhnCheckValidator but I guess they defined this alias to make it easier to find and understand).
  • @EAN for barcode numbers.
  • @SafeHtml validates that the string does not contain malicious code. It uses an external sanitizer library.

Are we interested in implementing any of these constraints?

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)Validator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.