mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-2910: JSON Pointer and JSON Patch syntax support #3623
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Jan 12, 2014).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user dunglas:
I plan to add support for JSON Pointer (RFC 6901: http://tools.ietf.org/html/rfc6901) and JSON Patch (RFC 6902: http://tools.ietf.org/html/rfc6902) syntaxes to Doctrine.
JSON Pointer and JSON Patch are useful to create Hypermedia REST API (HATEOAS).
Some higher level standards such as JSON API (http://jsonapi.org/) also rely on JSON Pointer and JSON Patch. My final thought is to implement JSON API support (serialization and update) on top of the Doctrine ORM.
The use case for the JSON pointer syntax is to access entity properties through an object graph.
Ex:
And for JSON Patch it's to modify a whole object graph.
In order to add some security, I also plan to create a new annotation to set access permissions on properties.
Ex :
I'd like some feedback before starting the implementation:
Thank you.
@doctrinebot commented on GitHub (Jan 12, 2014):
Comment created by @ocramius:
This idea is out of scope for ORM.
There's different projects you may look at:
These are obviously all trying to integrate with third party components, but the problem of REST APIs is out of the scope of persistence.
Please ping the people that are maintaining these projects before jumping forward and implementing from scratch.
And yes, the example API you've shown here is awesome - just out of scope for this project
@doctrinebot commented on GitHub (Jan 12, 2014):
Issue was closed with resolution "Won't Fix"
@doctrinebot commented on GitHub (Jan 12, 2014):
Comment created by dunglas:
Thanks for your reply.
I'm aware of these projects and in touch with people building HATEOAS (as a Symfony developper, other projects you mention are awesome but not fit my use case): https://github.com/willdurand/Hateoas/issues/130
It seems that it's not easy to implement JSON API / Patch /Pointer in this kind of libraries but I'm keeping an eye on it. Maybe that a tiny library focusing on JSON stuffs support (instead of all hypermedia related things like HATEOAS) can be a good start (and maybe that some code can be shared between projects).