nelmio / NelmioApiDocBundle

Generates documentation for your REST API from annotations
MIT License
2.22k stars 834 forks source link

[v4.1.1] Areas not working as expected #1771

Open michanismus opened 3 years ago

michanismus commented 3 years ago

I use this bundle with API Platform bundle. I followed the documentation on https://symfony.com/doc/4.x/bundles/NelmioApiDocBundle/areas.html

My config:

nelmio_api_doc:
    areas:
        store:
            path_patterns: [ ^/store-api ]
        default:
            path_patterns: [ ^/customer-sale-api ]

The route is defined as /api/doc/{area}.

The doc for /api/doc only shows tags with path pattern defined in default. Everything is fine.

The store area shows tags from store and default area but should only show store tags.

chrisguitarguy commented 2 years ago

Can you confirm this is still happening in the most recent versions of the bundle?

The store area shows tags from store and default area but should only show store tags

Emphasis mine. What do you mean by tags here? Open API Tags? As far as I know the areas stuff is separate from tags in OpenAPI.

Aerendir commented 1 year ago

@michanismus , did you solve this issue?

@chrisguitarguy , I have the same problem.

This is my configuration:

        my_custom_area:
            path_patterns: [ ^/api/accounts ]
        default:
            path_patterns: [ ^/api ]
            host_patterns: [ ^api\. ]

I expect that when I go to /api/doc/my_custom_area I see only endpoints that start with /api/accounts but, instead, I see all the defined endpoints.

To be concise, /api/doc and /api/doc/my_custom_area produce the same exact documentation with all the routes, without discriminating/filtering between endpoints.

Aerendir commented 1 year ago

Please, read here: https://github.com/nelmio/NelmioApiDocBundle/issues/2041

Areas are not supported by the integration with ApiPlatform.