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

FormRequest with arrays #29

Open
pleaz opened this issue Feb 5, 2020 · 4 comments
Open

FormRequest with arrays #29

pleaz opened this issue Feb 5, 2020 · 4 comments

Comments

@pleaz
Copy link
Contributor

pleaz commented Feb 5, 2020

when we use arrays validation, in "Example Value" it will generate null value for that parameter.

@mtrajano
Copy link
Owner

mtrajano commented Feb 6, 2020

Sorry can you provide a little more information for this? A short code snippet and expected output would really help

@pleaz
Copy link
Contributor Author

pleaz commented Feb 6, 2020

when validation FormRequest's class has something like this:

class SomeRequest extends FormRequest 
{
    public function rules()
    {
        return [
            'mass' => 'array',
            'mass.*.id' => 'required',
            'mass.*.name' => 'required',
...

then script generate this:

{
  "mass": [
    null
  ]
...

@mtrajano
Copy link
Owner

mtrajano commented Feb 6, 2020

That doesn’t seem right do the other params gets generated correctly? It may be related to a bug that got introduced but fixed recently, do you get the same results on 0.6.3?

@pleaz
Copy link
Contributor Author

pleaz commented Feb 7, 2020

I'm using that fork https://github.com/coopersystem-fsd/laravel-swagger, because option allows using JWT very handy

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

No branches or pull requests

2 participants