JSON field mapping validation #7250

Closed
opened 2026-01-22 15:48:07 +01:00 by admin · 2 comments
Owner

Originally created by @norkunas on GitHub (Nov 20, 2023).

Bug Report

Q A
BC Break no
Version 2.17

Summary

After #10946 when linting entities started getting:

The field 'App\Entity\Entity#value' has the property type 'mixed' that differs from the metadata field type 'array' returned by the 'json' DBAL type.
The field 'App\Entity\AnotherEntity#value' has the property type 'int' that differs from the metadata field type 'array' returned by the 'json' DBAL type.

JSON is not only array, but also can be a string or a number.

Current behavior

Wrong validation

How to reproduce

Declare json columns with other than array type.

Expected behavior

No errors

Originally created by @norkunas on GitHub (Nov 20, 2023). ### Bug Report | Q | A |------------ | ------ | BC Break | no | Version | 2.17 #### Summary After #10946 when linting entities started getting: > The field 'App\Entity\Entity#value' has the property type 'mixed' that differs from the metadata field type 'array' returned by the 'json' DBAL type. > The field 'App\Entity\AnotherEntity#value' has the property type 'int' that differs from the metadata field type 'array' returned by the 'json' DBAL type. JSON is not only array, but also can be a string or a number. #### Current behavior Wrong validation #### How to reproduce Declare json columns with other than array type. #### Expected behavior No errors
admin added the Bug label 2026-01-22 15:48:07 +01:00
admin closed this issue 2026-01-22 15:48:08 +01:00
Author
Owner

@greg0ire commented on GitHub (Nov 20, 2023):

Cc @DavideBicego

@greg0ire commented on GitHub (Nov 20, 2023): Cc @DavideBicego
Author
Owner

@derrabus commented on GitHub (Nov 20, 2023):

JSON is not only array, but also can be a string or a number.

… or a boolean. 🤓

@derrabus commented on GitHub (Nov 20, 2023): > JSON is not only array, but also can be a string or a number. … or a boolean. 🤓
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7250