Skip to content

[RFC] Revert the removal of boolean values in checkDNS option #23538

@javiereguiluz

Description

@javiereguiluz
Q A
Bug report? no
Feature request? no
BC Break report? no
RFC? yes
Symfony version 3.4

Traditionally, we used checkDNS like this:

AppBundle\Entity\Author:
    properties:
        bioUrl:
            - Url: { checkDNS: true }

After #23391, you must use it like this:

AppBundle\Entity\Author:
    properties:
        bioUrl:
            - Url: { checkDNS: !php/const:Symfony\Component\Validator\Constraints\Url::CHECK_DNS_TYPE_ANY }

Or use a "magic string" to define the expected non-boolean value:

AppBundle\Entity\Author:
    properties:
        bioUrl:
            - Url: { checkDNS: 'ANY' }

To me this change is a step backwards DX-wise. Why?

  • It's worse for the common case where you don't care about the DNS record type.
  • It's OK for the advanced case where you specify the DNS record type.
  • It doesn't work for the more advanced case where you want to allow more than one DNS record type.

My proposal:


Somewhat related to this, Fabien asked whether we should deprecate this checkDNS option entirely. See #23391 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRFC = 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