knuckleswtf / scribe

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

How to make the body parameters hidden on the html page #751

Open Nicolas-Mousten-WeCode opened 8 months ago

Nicolas-Mousten-WeCode commented 8 months ago

Scribe version

4.23

Your question

I have read the documentation and earlier questions where i found that no-example could maybe work but it only removed the body in the request.

Is there any other way to make sure that the docs dosen't have the section with body parameters?

Docs

shalvah commented 6 months ago

Nope, no way except for just not adding them. But you can definitely create a custom strategy or custom themes or something. What's your use case?

rizvikobemotor commented 4 months ago

The use case is here is my laravel form request, and I don't need to show the active body parameter to docs UI because I don't want to get user input

`<?php

namespace App\Http\Requests\Auth;

use Illuminate\Foundation\Http\FormRequest;

class LoginRequest extends FormRequest { public function authorize(): bool { return true; }

public function rules(): array
{
    return [
        'email' => ['required', 'email:rfc,dns', 'exists:users'],
        'password' => ['required', 'min:8'],
        'active' => ['present'],
    ];
}

protected function prepareForValidation(): void
{
    $this->merge([
        'active' => 1,
    ]);
}

} `

Screenshot 2024-02-21 at 10 53 38 AM