nelmio / NelmioApiDocBundle

Generates documentation for your REST API from annotations
MIT License
2.23k stars 836 forks source link

Swagger base path #1627

Closed ferriol closed 4 years ago

ferriol commented 4 years ago

Hi,

I'm using swagger and the path to the symfony app is http://myhost.com/symfonyapp/ and the swagger is http://myhost.com/symfonyapp/api/doc but swagger doesn't works because is looking its assets, for example, at: http://myhost.com/bundles/nelmioapidoc/init-swagger-ui.js I set host: apidev.motogp.com/payments in nelmio_api_doc.yaml What I have to set to make it work ?

GuilhemN commented 4 years ago

Hi, have you tried running the command described here : https://symfony.com/doc/current/bundles/NelmioApiDocBundle/faq.html#asset-files-not-loaded ?

ferriol commented 4 years ago

Hi, I tried your propose but doesn't work, problem still exists Screenshot from 2020-08-26 15-47-36 Screenshot from 2020-08-26 15-43-34

GuilhemN commented 4 years ago

@ferriol did you also run composer require symfony/asset?

ferriol commented 4 years ago

Is already installed:

composer require symfony/asset
Restricting packages listed in "symfony/symfony" to "4.4.*"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)         
Restricting packages listed in "symfony/symfony" to "4.4.*"
Nothing to install or update
ferriol commented 4 years ago

We solved adding the path in the asset bundle config

framework:
  assets:
    base_path: 'base_path/to/the/application'
GuilhemN commented 4 years ago

@ferriol thanks for the feedback.

This would probably be suited in our FAQ :)