Skip to content

docs: fix docs for the json type#5022

Merged
greg0ire merged 2 commits into
doctrine:2.13.xfrom
dunglas:docs/fix-json-type
Nov 25, 2021
Merged

docs: fix docs for the json type#5022
greg0ire merged 2 commits into
doctrine:2.13.xfrom
dunglas:docs/fix-json-type

Conversation

@dunglas

@dunglas dunglas commented Nov 25, 2021

Copy link
Copy Markdown
Contributor
Q A
Type bug
BC Break no
Fixed issues n/a

Summary

The documentation of the json type isn't in sync with the code. This PR fixes this.

fabpot added a commit to symfony/symfony that referenced this pull request Nov 25, 2021
…dunglas)

This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] Revert " add support for the JSON type"

This reverts commit 1e218c5.

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

As pointed out by @stof and @fancyweb on Slack, my patch is not in sync with Doctrine's code. Contrary to what is stated in the docs, Doctrine allows (almost) any PHP type to be stored as JSON. I also fixed the documentation of Doctrine: doctrine/dbal#5022

Commits
-------

a1e22dc Revert "[DoctrineBridge] add support for the JSON type"
@greg0ire

Copy link
Copy Markdown
Member

Contrary to what is stated in the docs, Doctrine allows (almost) any PHP type to be stored as JSON.

Hey @dunglas 👋 ! I can't see where the docs state that, and you don't seem to change it in this PR 🤔 Is this PR missing something? Or am I?

@stof

stof commented Nov 25, 2021

Copy link
Copy Markdown
Member

@greg0ire that's the whole point: the existing documentation says that it always convert to array or null. and that's wrong for the json type as not all JSON values are converted to arrays (json objects and json arrays are, but json scalars are not). See the removed lines of the diff.

@greg0ire

Copy link
Copy Markdown
Member
Contrary to what is stated in the docs, Doctrine allows (almost) any PHP type to be stored as JSON.

Ok, I thought that sentence was about encoding, but it might be interpreted as "You can get the same thing you set", which is indeed wrong.

@greg0ire greg0ire merged commit d0bae1b into doctrine:2.13.x Nov 25, 2021
@dunglas dunglas deleted the docs/fix-json-type branch November 26, 2021 14:51
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants