Ability to change json_encode() options
There is no way to modify json_encode() encode options except JSON_PRETTY_PRINT. For example we can't enable JSON_UNESCAPED_UNICODE or disable default options.
Extending the base class Zend\Json\Json as workaround creates another problems - can't use JsonRenderer with another Json encoder, Zend\Json\Json only: https://github.com/zendframework/zend-view/blob/master/src/Renderer/JsonRenderer.php#L127-L170
Hi,
Our immediate problem is that we need to pass JSON_FORCE_OBJECT to json_encode. This is because the JSON output an API document that expects an integer-indexed-object, rather an array.
Is there any objection to us adding this functionality and submitting a pull request with it in?
Seems acceptable, although since JSON_THROW flags are now existing directly in core, this component can most likely be removed from your codebase instead...
This repository has been closed and moved to laminas/laminas-json; a new issue has been opened at https://github.com/laminas/laminas-json/issues/4.