Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Q] Deprecate toJSON and fromJSON? #212

Open
Mark-H opened this issue Oct 19, 2021 · 3 comments
Open

[Q] Deprecate toJSON and fromJSON? #212

Mark-H opened this issue Oct 19, 2021 · 3 comments

Comments

@Mark-H
Copy link
Collaborator

Mark-H commented Oct 19, 2021

In the MODX deprecations issue there's the question of toJSON and fromJSON utilities, and wether that's still necessary or should be removed.

I'd say deprecating them would be a pretty safe bet these days.

@wshawn
Copy link

wshawn commented Feb 7, 2022

For those working with and writing APIs, the removal of fromJSON and toJSON would be catastrophic. I have even suggest the addition of toXML and fromXML. Do not forget there was a huge push for REST in MODX.

@Mark-H
Copy link
Collaborator Author

Mark-H commented Feb 7, 2022

It would certainly be a breaking change which requires deprecating it before removing to make sure people currently using it are notified before it's actualy gone...

... but how is it catastrophic when json_encode and json_decode are equivalent and have been widely supported for like a decade? A basic find and replace could update a codebase in like 30 seconds.

@wshawn
Copy link

wshawn commented Feb 7, 2022

Catastrophic is an overstatement, I admit. From an API developer standpoint having the output data types closest to the raw data is the best -- especially as databases have a native json fieldtype. I will make changes on my two year old xpdo3 applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants