Problem/Motivation
There is a issue on the REST listings which is pulling the disabled resources though they are are enabled once. This results in website error.
Initially we enabled the node api for testing purposes. Though we disabled it, it is taken into account with partial values and so we are getting this error "Exception: No route found for REST resource, entity.node" related to node API.
Steps to reproduce
Enable the restui module and navigate to admin/config/services/rest
Enable the "Content" resource and define the necessary settings.
Enable the openapi_ui module.
Navigate to admin/config/services/openapi
Click the "View/Download" button of REST Specification
You should be seeing the json format of Content resource.
Now navigate back to REST Listing page (admin/config/services/rest) and disable the "Content" resource.
Navigate to admin/config/services/openapi and click the "View/Download" button of REST Specification.
You will be seeing the error
The website encountered an unexpected error. Please try again later.
Exception: No route found for REST resource, entity.comment, for method GET in Drupal\openapi_rest\Plugin\openapi\OpenApiGenerator\RestGenerator->getRouteForResourceMethod() (line 287 of modules/contrib/openapi_rest/src/Plugin/openapi/OpenApiGenerator/RestGenerator.php).
Proposed resolution
Need conditional logic to filter only the enabled REST resources.