cakephp-swagger icon indicating copy to clipboard operation
cakephp-swagger copied to clipboard

Https loading assets [QUESTION]

Open Petrucheqa opened this issue 7 years ago • 1 comments

Hello, I'm stuck with mixed content error. I'm on cloud hosting running https, but swagger try to load assets in HTTP.

Here is my swagger configuration

` use Cake\Core\Configure; return [ 'Swagger' => [ 'ui' => [ 'title' => 'PBE API Documentation', 'validator' => true, 'api_selector' => true, 'route' => 'api/swagger/', 'schemes' => ['https'] ], 'docs' => [ 'crawl' => Configure::read('debug'), 'route' => '/swagger/docs/', 'cors' => [ 'Access-Control-Allow-Origin' => '*', 'Access-Control-Allow-Methods' => 'GET, POST', 'Access-Control-Allow-Headers' => 'X-Requested-With' ] ], 'library' => [ 'api' => [ 'include' => ROOT . DS . 'src' . DS . 'Controller' . DS . 'Api', 'exclude' => [ '/Editor/' ] ] ] ] ];

`

Locally it works but not in production.

I don't understand.

Thank you, for your time

Petrucheqa avatar Jun 14 '18 15:06 Petrucheqa

Do you have https in your swagger doc scheme aswell?

**

  • @SWG\Swagger(
  • schemes={"https"},
    
  • host="/api/v1/",
    

frogjimjaff avatar Jul 05 '18 16:07 frogjimjaff