Disable caching of JSON:API for debugging purposes

Disabling caching on JSON API endpoints doesnt seem possible with using just below in your sevices file

services:
  cache.backend.null:
    class: Drupal\Core\Cache\NullBackendFactory

so I found a hackish solution to use while I test the endpoints. Find flattenResponse method that is in ResourceResponseSubscriber class in Drupal\jsonapi\EventSubscriber and add to bottom of it

    $disable_cache = new CacheableMetadata();
    $disable_cache->setCacheMaxAge(0);
    $final_response->addCacheableDependency($disable_cache);
    return $final_response;

and this will add meta tag that will force this responses to be uncached. Also add to top of the file use Drupal\Core\Cache\CacheableMetadata;  so method cand be found. This will help you have JSON file uncached all the time.