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

Problems with empty objects on same level #33

Closed
narcoticfresh opened this issue Aug 18, 2016 · 1 comment
Closed

Problems with empty objects on same level #33

narcoticfresh opened this issue Aug 18, 2016 · 1 comment

Comments

@narcoticfresh
Copy link
Contributor

narcoticfresh commented Aug 18, 2016

After #28 and #30 we discovered another wrong behavior with empty objects in the path of operations..

-> I opened PR #32 to demonstrate the wrong behavior..

As it seems, it stems from the fact that json_decode($value, true) is also done in raphaelstolt/php-jsonpointer - thus objects are changed to arrays after performing the operation.

I'm not really sure how to proceed at that point.. I don't know where this lib (raphaelstolt/php-jsonpointer) is also used..

I tried to work around the issue by just taking the appropiate array member from whatever I get from php-jsonpointer, but that again makes problems with tests like this: https://github.com/raphaelstolt/php-jsonpatch/blob/master/tests/unit/Rs/Json/Patch/Operations/AddTest.php#L197

Can the same type of fix i did in this library (json_encode()ing to object) also be easily done in php-jsonpointer?

@narcoticfresh narcoticfresh changed the title Problems with empty objects in path Problems with empty objects on same level Aug 18, 2016
@narcoticfresh
Copy link
Contributor Author

@raphaelstolt the new PR is #34, please see additional explanation there.. thanks

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

1 participant