Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@urlParam not overriding ID parameters #873

Open
1 task done
elanclarkson opened this issue Jul 22, 2024 · 2 comments
Open
1 task done

@urlParam not overriding ID parameters #873

elanclarkson opened this issue Jul 22, 2024 · 2 comments
Labels
bug Something isn't working triage

Comments

@elanclarkson
Copy link

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

@elanclarkson elanclarkson added bug Something isn't working triage labels Jul 22, 2024
@shalvah
Copy link
Contributor

shalvah commented Jul 23, 2024

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?

@Nguemoue
Copy link

Nguemoue commented Nov 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

3 participants