Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nelmio ApiDoc 3.0 - exclude section from SwaggerUI

I want to exclude section "default" from SwaggerUI - in there I keep routes that I do not want to expose. I know that in version 2.x of Nelmio Apidoc there was a parameter called exclude_sections in config.yml - how can I do that with 3.0 beta version?

like image 558
Karol Gącik Avatar asked Sep 01 '25 22:09

Karol Gącik


1 Answers

You can use the areas section in config.yml, setting the default area to whichever routes you want:

nelmio_api_doc:
    documentation:
        [...]
    areas:
        default:
            path_patterns: [ ^/user, ^/customer ]

This config will set under api/doc only the routes you put in the array.

like image 146
Krleza Avatar answered Sep 03 '25 20:09

Krleza