Проблема рендеринга с NelmioApiDocBundle - PullRequest
0 голосов
/ 08 января 2020

У меня проблема с пакетом "NelmioApiDocBundle".

мой рендеринг https://localhost: 8000 / api / do c

Рендеринг неформатированный когда это должно быть гораздо больше дизайна.

***routes.yaml***

api_login_check:
        path: /api/login_check

    app.swagger:
        path: /api/doc
        methods: GET
        defaults: { _controller: nelmio_api_doc.controller.swagger }

мои связки

***bundles.php***

return [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
    Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
    Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
    Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
    Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
    Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
    Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
    Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
    Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
    Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
    Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
    Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
    Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true],

];

У вас были такие проблемы ?

Спасибо

1 Ответ

1 голос
/ 27 марта 2020

Я только что прошел ту же проблему, вы пробовали

$ composer require asset?

Это исправило это для меня.

У меня был фла sh, когда Я заметил в config / routs / dev / nelmio_api_do c .yaml

# Expose your documentation as JSON swagger compliant
app.swagger:
    path: /api/doc.json
    methods: GET
    defaults: { _controller: nelmio_api_doc.controller.swagger }

## Requires the Asset component and the Twig bundle
## $ composer require twig asset
# app.swagger_ui:
#   path: /api/doc
#   methods: GET
#   defaults: { _controller: nelmio_api_doc.controller.swagger_ui }

Сначала я попытался заменить путь в первом блоке на / api / do c без ". json «но это не сработало, тогда я прочитал второй блок, мне потребовалось некоторое время, чтобы определить настоящую проблему.

...