knuckleswtf / knuckleswtf/scribe

Demo site examples and collection schemas are broken

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

Description

### Scribe version

5.1.0

### PHP version

8.4.5

### Laravel version

12.3.0

### Scribe config

```ruby
type => "external_laravel"
theme => "scalar"
try_it_out.use_csrf => true
auth.in => "header"
auth.name => "Cookie"
```

### What happened?

> [!IMPORTANT]
> This issue stems from an underlying issue in `scribe` which can also be experienced in local development environments

In some instances of the examples on the `The SideProject API` demo page a few issues can be notably seen:

[Failed responses](https://demo.scribe.knuckles.wtf/#tag/dummy-endpoints/POST/api/file-input)
![Image](https://github.com/user-attachments/assets/bf7cfc58-53e0-4940-851e-0045324c70b1)

[Incorrect schema generation for collections](https://demo.scribe.knuckles.wtf/#tag/dummy-endpoints/POST/api/array-body)
![Image](https://github.com/user-attachments/assets/f351798e-1dd6-4d78-b728-f41b2118e8fd)
![Image](https://github.com/user-attachments/assets/d8e2b670-73f6-4103-9747-0c3aef9f39bc)

### Personal Example:

```php
...
#[ResponseFromApiResource(ResourceCollection::class, User::class, collection: true, withCount: ['roles', 'permissions', 'teams'])]
public function index()
{
return User::withCount(['roles', 'permissions', 'teams'])->get()->all();
}
...
```

![Image](https://github.com/user-attachments/assets/7c2967ca-8a58-4411-9cf8-16f746e956f0)
![Image](https://github.com/user-attachments/assets/bffff0af-425a-469a-9e79-6239155a4a01)

### 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 failed file-input example and incorrect collection schema on the linked demo pages using the reported Scribe, PHP, and Laravel versions. Trace the relevant Scribe handling for those examples; done means the demo responses succeed and collection schemas are generated correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
api, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.