What is a stub?
In testing land, a stub replaces real behavior with a fixed version. In the case of HTTP requests, instead of making the actual call, a stub fakes the call and provides a canned response that can be used to test against.
In Drupal development, this has become extremely use full when writing tests, dealing with development or incomplete API endpoints or possible unreachable/protected endpoints.
I never could find something to serve this purpose so developed Stubby, and API Stubbing module for D8/D9.
At current time, it supports providing a specified path and optional parameters, and setting the JSON response and HTTP response code.
It also has pluggable parameters with custom error code and message validation to allow a bit more of a dynamic experience which comes into play when dealing with larger API's.

Check out the project page and give'r a try: https://www.drupal.org/project/stubby