knuckleswtf / scribe

Generate API documentation for humans from your Laravel codebase.✍
https://scribe.knuckles.wtf/laravel/
MIT License
1.7k stars 302 forks source link

Issue Documenting Array of objects #892

Open RajviPJain opened 2 weeks ago

RajviPJain commented 2 weeks ago

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

/**

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

Given Output image

Actual Output image

Docs

shalvah commented 2 weeks ago

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.

RajviPJain commented 2 weeks ago

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 commented 2 weeks ago

I don't see any option to reopen this issue

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

Thanks

shalvah commented 1 week ago

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