nostop8 / yii2-rest-api-doc

Simple documentation generator for Yii2 REST applications based on defined API endpoints and actions annotations.
MIT License
21 stars 15 forks source link

Collapsed API boxes don't open for controllers in modules #7

Closed Lalien closed 5 years ago

Lalien commented 5 years ago

If you are using a controller that is inside of a module like this:

        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                [
                    'class' => 'yii\rest\UrlRule',
                    'controller' => ['markets' => 'dynamic-pricing/market'],
                    'prefix' => '/api/',
                    'only' => [
                        'GET /' => 'index',
                    ]
                ]   
            ],
        ],

You will receive this console error when trying to open the collapsed API box: Uncaught Error: Syntax error, unrecognized expression: #Dynamic-pricing/market

It seems to be from there being a slash in the anchor link. Should we just replace these forward slashes with dashes? I tried that locally and it seems to fix the issue. The only problem is that I'm stuck with a title like "Dynamic-pricing-market" in the header.

Lalien commented 5 years ago

If you are using a controller that is inside of a module like this:

        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                [
                    'class' => 'yii\rest\UrlRule',
                    'controller' => ['markets' => 'dynamic-pricing/market'],
                    'prefix' => '/api/',
                    'only' => [
                        'GET /' => 'index',
                    ]
                ]   
            ],
        ],

You will receive this console error when trying to open the collapsed API box: Uncaught Error: Syntax error, unrecognized expression: #Dynamic-pricing/market

It seems to be from there being a slash in the anchor link. Should we just replace these forward slashes with dashes? I tried that locally and it seems to fix the issue. The only problem is that I'm stuck with a title like "Dynamic-pricing-market" in the header.