knuckleswtf/scribe

@urlParam not overriding ID parameters

elanclarkson opened this issue · 2 comments

Scribe version

4.37.1

PHP version

8.3

Framework

Laravel

Framework version

11.15.0

Scribe config

type => "external_static"
theme => "scalar"
try_it_out.use_csrf => true
postman.enabled => false

What happened?

I attempted to add the @urlParam comment for an ID field where the primary key is a column other than ID (called 'Symbol'), and it did not override the generated documentation contrary to what is explained in Scribe's documentation here: https://scribe.knuckles.wtf/laravel/documenting/url-parameters

Screenshot 2024-07-22 at 7 12 57 PM

My route is as follows:

Route::get('/symbol/{symbol}/{interval}/{startDate}/{endDate}', [SymbolController::class, 'show']);

My comment above the show function is as follows:

@urlParam symbol string required The symbol ticker to get data for (case-sensitive) Example: AAPL

But instead of displaying my custom description in the generated documentation, it lists 'symbol_Symbol' as the parameter and has no description. I can override the description by changing the comment to @urlParam symbol_Symbol string required The symbol ticker to get data for (case-sensitive) Example: AAPL to match what is being generated, but I want the parameter to be correctly labelled symbol rather than symbol_Symbol.

Other than that this is a great tool, thank you developers!

Docs

Hmmm, that's weird. The parameter name is being wrongly inferred for some reason. What does it show as the endpoint URL in the docs?

Same problem for me

Hmmm, that's weird. The parameter name is being wrongly inferred for some reason. What does it show as the endpoint URL in the docs?
Imagine if i have route like this
/api/v1/userRole/{roleType}/existBy and in controller i add

#UrlPararam(['roleType'])

image

it will not take charge of it