laminas / laminas-diactoros

PSR HTTP Message implementations
https://docs.laminas.dev/laminas-diactoros/
BSD 3-Clause "New" or "Revised" License
483 stars 63 forks source link

Correctly handle explicitly providing `JSON_THROW_ON_ERROR` in `JsonResponse` #169

Closed TimWolla closed 1 year ago

TimWolla commented 1 year ago
Q A
Documentation no
Bugfix yes
BC Break maybe
New Feature no
RFC no
QA no

Description

If the JSON_THROW_ON_ERROR flag is explicitly given, jsonEncode() violates its contract to throw InvalidArgumentException if it is unable to encode the input as JSON.