Search code examples
phprestler

Show protected methods in SWAGGER (RESTLER 3)


Im making an API, and I really like the SWAGGER interface for methods, but all my API requests will need to be protected and verified by Basic Auth. So any of those protected methods or classes will be available for SWAGGER. Is there any way to show them ?


Solution

  • Placing the following in your index.php will enable listing of protected methods

    use \Luracast\Restler\Resources;
    
    Resources::$hideProtected = false;
    

    Accessing Basic Auth protected api from swagger will work just fine. But authenticating and getting through basic auth will require some work done on the swagger ui side