Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] No-example value with formRequest bodyParameter and queryPameters #511

Merged
merged 1 commit into from
Aug 25, 2022

Conversation

leandrodiogenes
Copy link
Contributor

Issue requests #448 and #510

This feature, allows to make 'No-example' values on FormRequest strategy.

It is possible to hide an attribute from example output.

Only works on non required attributes

Just add an example with a value 'No-example' on queryParameters or bodyParameters method on any FormRequest.

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class PostRequest extends FormRequest {
    public function rules(): array {
        return [
            'filter' => ['string', 'max:255'],
            'page' => ['int'],
        ];
    }

    public function queryParameters() {
        return [
            'filter' => [
                'description' => 'Name of post',
                'example' => 'John',
            ],
            'page' => [
                'example' => 'No-example',
            ],
        ];
    }
}

image

@shalvah shalvah merged commit 6104942 into knuckleswtf:master Aug 25, 2022
@shalvah shalvah mentioned this pull request Sep 10, 2022
1 task
@shalvah shalvah mentioned this pull request Dec 2, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants