Better Json Response
1 sites
Security covered
This module improves Drupal's JSON response capabilities by simplifying debugging and enhancing JSON:API support. It allows disabling the JSON response cache directly from the admin interface and enables displaying any entity in JSON:API format with the option to include related data.
CacheableJsonResponse is a powerful tool that can easily enhance the performance of your headless site.
However, it has two main drawbacks:
- Debugging challenges: If you encounter an issue, you need to replace CacheableJsonResponse with JsonResponse or clear the cache after every change, which can be cumbersome.
- JSON:API format limitation: It doesn’t support displaying entities in the JSON:API format.
This module solves both problems:
- Simplified debugging: By using the BetterJsonResponse class instead of CacheableJsonResponse, you can disable the JSON response cache directly from the back office with a single checkbox.
- Enhanced JSON:API support: You can now display any entity in JSON:API format, with the ability to add includes as needed.