phpsymfonysymfony-3.4nelmioapidocbundle

Disabling Sandbox for NelmioApiDocs on Symfony 3.4


i want to disable the sandbox mode for NelmioApiDocs on Symfony "v3.4.11" and nelmio/api-doc-bundle "v3.2.1"

I've tried:

# app/config/config.yml

# nelmio_api_doc
nelmio_api_doc:
    documentation:
        sandbox:
            enabled: false

After that i cleared the cache for prod and dev. But it did not work, i can still send api tests with "Try it out".

Can someone help me to disable this "Try it out" feature?

Kind Regards, Benjamin


Solution

  • Since the answer from Denis St-Michel was not working for me, i've added css to hide the button:

    {# create in app\Resources\NelmioApiDocBundle\views\SwaggerUi\index.html.twig #}
    {% extends '@!NelmioApiDoc/SwaggerUi/index.html.twig' %}
    
    {% block stylesheets %}
    {{ parent() }}
    {#  Eine Config zur Deaktivierung des Buttons hat leider nicht funktioniert, daher einfach ausgeblended  #}
    <style>
        .try-out {
            display: none;
        }
    </style>
    {% endblock stylesheets %}
    

    Not the best way, but working for me.