Nelmioapidocbundle: Documentation of Areas

Created on 9 Jul 2019  路  4Comments  路  Source: nelmio/NelmioApiDocBundle

How to describe areas, whats the correct way?
You wrote it was fixed in #1307 and #1404, but in current version its not working, why removed code?

Thats not working for me (v3.4.0):

nelmio_api_doc:
    areas:
        default:
            path_patterns: [ ^/api/route1 ]
            documentation:
                description: "This is the documentation for route1"
            with_annotation: true
        test:
            path_patterns: [ ^/api/route2 ]
            documentation:
                description: "This is the documentation for route2"
            with_annotation: true

Most helpful comment

In fact, the syntax mentionned in #1307 is not correct, you should use:

nelmio_api_doc:
    areas:
        default:
            path_patterns: [ ^/api/route1 ]
            documentation:
                info:
                    description: "This is the documentation for route1"

I updated the description of #1307 to avoid any future confusion, thanks :)

All 4 comments

What do you mean by "not working"?
Is it not what you expected? Or are you getting an error?

If you want to update the description of a route, this is not the correct configuration, you should use annotations in your controller.

I have to areas: default and test. I expect that the description "This is the..." will be displayed on top of page, but it isnt. I want to describe the areas with two different descriptions.

In fact, the syntax mentionned in #1307 is not correct, you should use:

nelmio_api_doc:
    areas:
        default:
            path_patterns: [ ^/api/route1 ]
            documentation:
                info:
                    description: "This is the documentation for route1"

I updated the description of #1307 to avoid any future confusion, thanks :)

Thats it, now working, thanks a lot for your help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jhkchan picture jhkchan  路  4Comments

smuralidharan picture smuralidharan  路  3Comments

numediaweb picture numediaweb  路  4Comments

GuilhemN picture GuilhemN  路  6Comments

knyk picture knyk  路  6Comments