Issues

ZF-12143: Built in JSON encoder ignores NULL values when encoding objects.

Issue Type: Bug Created: 2012-04-10T12:45:32.000+0000 Last Updated: 2012-04-10T12:53:16.000+0000 Status: Open Fix version(s): Reporter: Maarten Dubelaar (dubelaar) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Json

  • encode
  • json
  • null
  • object

Related issues: Attachments:

Description

In the built in JSON encoder method _encodeObject() the property is ignored if the value is not set. This means that all properties which have NULL as value are not included in the JSON output.

If the built in encoder really behaves exactly the same as json_encode (like the documentation states) it would include all properties also the ones that have NULL as a value. Optionally an ignoreNullValues option could be added instead.

Comments

No comments to display

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts