Categories
CMS Magento Mastering Development

In magento 2.3.5 Swagger is not working (Failed to load API definition.)

I had upgraded the magento version to 2.3.5 after that swagger is not working in my setup

Image Reference :
enter image description here

To debug the i click invalid button it shows

{"schemaValidationMessages":[{"level":"error","message":"Can't read from file http://My Domain/rest/all/schema?services=all"}]}

The below errors i got in the debug.log

[2020-06-30 08:50:34] main.ERROR: Unable to resolve the source file for 'frontend/Vendor/child-theme/en_US/Magento_Swagger/swagger-ui/js/swagger-ui-bundle.js.map' [] []
[2020-06-30 08:50:34] main.CRITICAL: Unable to resolve the source file for 'frontend/Vendor/child-theme/en_US/Magento_Swagger/swagger-ui/js/swagger-ui-bundle.js.map' [] []
[2020-06-30 08:50:34] main.ERROR: Unable to resolve the source file for 'frontend/Vendor/child-theme/en_US/Magento_Swagger/swagger-ui/css/swagger-ui.css.map' [] []
[2020-06-30 08:50:34] main.CRITICAL: Unable to resolve the source file for 'frontend/Vendor/child-theme/en_US/Magento_Swagger/swagger-ui/css/swagger-ui.css.map' [] []
[2020-06-30 08:50:34] main.ERROR: Unable to resolve the source file for 'frontend/Vendor/child-theme/en_US/Magento_Swagger/swagger-ui/js/swagger-ui-standalone-preset.js.map' [] []
[2020-06-30 08:50:34] main.CRITICAL: Unable to resolve the source file for 'frontend/Vendor/child-theme/en_US/Magento_Swagger/swagger-ui/js/swagger-ui-standalone-preset.js.map' [] []

I ran the below commands and tested

  1. bin/magento deploy:mode:set developer – (Set the store to developer mode)
  2. Removed the pub/static frontend and adminhtml
  3. php bin/magento setup:upgrade
  4. php bin/magento setup:static-content:deploy -f
  5. php bin/magento setup:di:compile
  6. chmod -R 777 root_file/*

Leave a Reply

Your email address will not be published. Required fields are marked *