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

{object} need to replace with Id or other text. #798

Open
brnrajoriya opened this issue Nov 27, 2020 · 1 comment
Open

{object} need to replace with Id or other text. #798

brnrajoriya opened this issue Nov 27, 2020 · 1 comment

Comments

@brnrajoriya
Copy link

I have generated a doc using this package. And it is working fine. But Whoever is reading the doc is confused by {Object} text. As the resource route of accounts is showing APIs like GET api/accounts/{account}. Here reader having doubt to replace the account id in place of {account}. Is there any way to customize this.

Thanks in Advance.

@imami
Copy link

imami commented Dec 2, 2020

This is not an issue about this package, it's about the way you add metadata to your code's docblock.

You may use docblocks like :

/**
 * Show Account
 *
 * @urlParam account required
 */
public function show(Account $account)
{
    // ...
}

just before corresponding controller method or even your validation form request. laravel-apidoc-generator would detect that param and add that name to generated documents.
It would even be better add some description or example too.

/**
 * Show Account
 *
 * @urlParam account required Some description here. Example:brnrajoriya
 */
public function show(Account $account)
{
    // ...
}

then you would have something like this:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants