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

Issue Documenting Array of objects #892

Open
1 task done
RajviPJain opened this issue Sep 19, 2024 · 4 comments
Open
1 task done

Issue Documenting Array of objects #892

RajviPJain opened this issue Sep 19, 2024 · 4 comments
Labels
bug Something isn't working validated

Comments

@RajviPJain
Copy link

Scribe version

4.37

PHP version

8.1

Framework

Laravel

Framework version

9.19

Scribe config

title => "SCRIBE"
type => "laravel"
laravel.add_routes => false
auth.enabled => true
auth.placeholder => "token"
strategies.responses => added [
    'Knuckles\\Scribe\\Extracting\\Strategies\\Responses\\ResponseCalls',
    [
        'only' => [
            'GET *',
        ],
    ],
]: removed [
    'Knuckles\\Scribe\\Extracting\\Strategies\\Responses\\ResponseCalls',
    [
        'only' => [
            'GET *',
        ],
        'config' => [
            'app.debug' => false,
        ],
    ],
]

What happened?

I have used the following code comments

/**

  • @bodyParam user object required The user details
  • @bodyParam user.name string required The user's name
  • @bodyParam user.age string required The user's age
  • @bodyParam friend_ids int[] List of the user's friends.
  • @bodyParam cars object[] List of cars
  • @bodyParam cars[].year string The year the car was made. Example: 1997
  • @bodyParam cars[].make string The make of the car. Example: Toyota
    */

But it is not generating docs as per given output in docs

Given Output
image

Actual Output
image

Docs

@RajviPJain RajviPJain added bug Something isn't working triage labels Sep 19, 2024
@shalvah
Copy link
Contributor

shalvah commented Sep 19, 2024

I don't think this is a bug. That's just an old screenshot. We don't show the full name anymore (cars[].year), since it's now visually nested under cars.

@shalvah shalvah closed this as completed Sep 19, 2024
@RajviPJain
Copy link
Author

Thank you for the clarification. However, I still believe the previous visual representation was clearer. For example, even if the user names the variable car, the nested variable would appear as car[].year. This format explicitly indicates that car is an array of objects, which enhances understanding for other users.

It would be helpful to revert to the old visual representation. If that's not feasible, I suggest updating the current documentation to align with the example output, as it currently may lead to confusion.

Thank you for considering my feedback!

@RajviPJain
Copy link
Author

I don't see any option to reopen this issue

@shalvah can you please reopen this issue if possible at your end?

Thanks

@shalvah
Copy link
Contributor

shalvah commented Sep 24, 2024

Yeah, the screenshot should be updated. The parameter naming should stay as is.

@shalvah shalvah reopened this Sep 24, 2024
@shalvah shalvah added validated and removed triage labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working validated
Projects
None yet
Development

No branches or pull requests

3 participants
@shalvah @RajviPJain and others