knuckleswtf / knuckleswtf/scribe

Issue Documenting Array of objects

Open
#892 4 comments 0 reactions 0 assignees View on GitHub
bug validated
Dominant language
PHP
Stars
2.3k
Forks
357
PR merge metrics
No merged PRs in 30d

Description

### Scribe version

4.37

### PHP version

8.1

### Framework

Laravel

### Framework version

9.19

### Scribe config

```ruby
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](https://github.com/user-attachments/assets/8acb5710-7d90-43e6-bcef-ac4552467bc6)

Actual Output
![image](https://github.com/user-attachments/assets/7c9ab959-2bdd-4e65-92dd-6491066fa79a)

### Docs

- [X] I've checked [the docs](https://scribe.knuckles.wtf/laravel), the [troubleshooting guide](https://scribe.knuckles.wtf/laravel/troubleshooting), and [existing issues](https://github.com/knuckleswtf/scribe/issues?q=is%3Aissue+), but I didn't find a solution

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the generated documentation in Laravel 9.19 with the supplied @bodyParam annotations, especially the cars object[] fields. Compare the result with the linked expected and actual screenshots; done when arrays of objects and their year and make fields render as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
api, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.