knuckleswtf / knuckleswtf/scribe
How to hide certain body parameters
- Dominant language
- PHP
- Stars
- 2.3k
- Forks
- 357
- PR merge metrics
- No merged PRs in 30d
Description
### Scribe version
5.5
### Your question
If you inject external data into the form in the Laravel request as shown below, Scribe interprets it as if it were sent by the client and generates the document accordingly.
If Scribe is compiled from a formRequest, it does not take into account the comments on the Request.
How can I manually add a feature like @bodyparams id hidden?
` protected function prepareForValidation()
{
$this->merge([
'id' => $this->route('id'),
]);
}
public function rules(): array
{
return [
'name' => 'required|int',
];
}
`
It requests the ID and name in the generated postman item. However, the server injects the ID itself.
### 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
Research direction
Start by tracing how Scribe handles the Laravel FormRequest example, especially prepareForValidation() and rules(). Determine where injected route data becomes a documented body parameter, then verify that the generated Postman item can omit id while retaining name. Done means users have a documented way to hide server-injected body parameters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- laravel, php
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100