Mapping matrix broken after upgrade to version 3.17.* #7272

Open
opened 2026-01-22 15:48:40 +01:00 by admin · 0 comments
Owner

Originally created by @bednic on GitHub (Dec 6, 2023).

BC Break Report

Q A
BC Break yes
Version 3.17.*

Summary

As described in documentation PHP data type mixed should be possible map to JSON database type. After upgrading to 3.17.1 version this is not true anymore, and orm:schema-validate writes error because database json can now be mapped only to PHP array data type. Thus I lost posibility to use PHP mixed data type.

Previous behavior

Map PHP mixed data type to database JSON type.

Current behavior

ORM schema validation shows errors, because database JSON type can be mapped only to PHP array data type.

How to reproduce

#[ORM\Entity(SystemPropertyRepository::class)]
#[ORM\Table(schema: 'dw')]
class SystemProperty extends DataEntityWithKey
{
    /**
     * @var array value
     */
    #[ORM\Column(type: 'json')] //<-- this should be possible
    public mixed $value;
}

Originally created by @bednic on GitHub (Dec 6, 2023). <!-- Before reporting a BC break, please consult the upgrading document to make sure it's not an expected change: https://github.com/doctrine/orm/blob/2.9.x/UPGRADE.md --> ### BC Break Report <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |------------ | ------ | BC Break | yes | Version | 3.17.* #### Summary As described in [documentation ](https://www.doctrine-project.org/projects/doctrine-dbal/en/3.7/reference/types.html#mapping-matrix) PHP data type `mixed` should be possible map to `JSON` database type. After upgrading to 3.17.1 version this is not true anymore, and **orm:schema-validate** writes error because database json can now be mapped **only** to PHP array data type. Thus I lost posibility to use PHP mixed data type. #### Previous behavior Map PHP mixed data type to database JSON type. #### Current behavior ORM schema validation shows errors, because database JSON type can be mapped only to PHP array data type. #### How to reproduce ```php #[ORM\Entity(SystemPropertyRepository::class)] #[ORM\Table(schema: 'dw')] class SystemProperty extends DataEntityWithKey { /** * @var array value */ #[ORM\Column(type: 'json')] //<-- this should be possible public mixed $value; } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7272