Our default error serializer already supports rudimentary content negotiation between JSON, XML, or rendering no content at all.
We ought to extend this negotiation to all configured response media handlers, possibly somehow plugging JSON and XML as fallback if these are absent in the default handlers (JSON is there by default, but can be removed by the developer).
Implementation details TBD; this might be designed as a breaking change, or an iterative improvement, depending on how this feature is governed by configurable options, and what fallback mechanisms are available. If we handle this in a non-breaking way, it may make it into the 4.x series.
Our default error serializer already supports rudimentary content negotiation between JSON, XML, or rendering no content at all.
We ought to extend this negotiation to all configured response media handlers, possibly somehow plugging JSON and XML as fallback if these are absent in the default handlers (JSON is there by default, but can be removed by the developer).
This has already been improved in Falcon 3.0 for JSON almost as defined here as part of https://github.com/falconry/falcon/pull/1768 by @CaselIT.
Implementation details TBD; this might be designed as a breaking change, or an iterative improvement, depending on how this feature is governed by configurable options, and what fallback mechanisms are available. If we handle this in a non-breaking way, it may make it into the 4.x series.