-
Notifications
You must be signed in to change notification settings - Fork 86
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
nullable subjson #133
Labels
Comments
Hey, sorry at this moment it's impossible. But I think it should be possible to create something like:
This would require to create |
This was referenced Aug 11, 2019
Hey, I'm happy to let you know that after I merged #173 following code will work just like you expected: (new MatcherFactory())->match(
'{"image":null}',
'{"image":"@null@||@[email protected]({\"url\":\"@[email protected]()\"})"}'
);
(new MatcherFactory())->match(
'{"image":{"url":"http://image.com"}}',
'{"image":"@null@||@[email protected]({\"url\":\"@[email protected]()\"})"}'
);
(new MatcherFactory())->match(
'{"image":{"url":"http://image.com"}}',
'{"image":"@[email protected](optional(), match({\"url\":\"@[email protected]()\"}) )"}'
); Feel free to use |
Awsome ! thx @norzechowicz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Is there a way to match that json property can be an object matching my matcher AND can also be null:
But my image object can be null like this:
Thanks for your help
The text was updated successfully, but these errors were encountered: