Skip to content

[Q] Deprecate toJSON and fromJSON? #212

Open

Description

@Mark-H

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.

Activity

  1. wshawn commented on Feb 7, 2022

    @wshawn

    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.

  2. Mark-H commented on Feb 7, 2022

    @Mark-H
    ContributorAuthor

    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.

  3. wshawn commented on Feb 7, 2022

    @wshawn

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions