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

Can't parse array validation rules? #52

Closed
torkiljohnsen opened this issue Jun 27, 2016 · 7 comments
Closed

Can't parse array validation rules? #52

torkiljohnsen opened this issue Jun 27, 2016 · 7 comments

Comments

@torkiljohnsen
Copy link

Seems as if the rules parser is unable to parse rules as the ones described here: https://laravel.com/docs/5.2/validation#validating-arrays

For instance users.*.email.

At least these do not show up in my parameters list in the generated documentation at all.

@jgardezi
Copy link

jgardezi commented Jul 8, 2016

@torkiljohnsen have a look at this issue #1 (comment). This might help to parse the array as well.

@jwolowski
Copy link

Is there a solution to this issue already?

@torkiljohnsen
Copy link
Author

I gave up on this.

@jwolowski
Copy link

That's not good news, but thanks anyway.
@mpociot @jgardezi do you have any idea about how to solve this issue?

@uqclien
Copy link

uqclien commented Jun 22, 2017

Hi @mpociot we are having the same issue, without the input data, L5.4 will remove rules with wildcard: https://github.com/laravel/framework/blob/5.4/src/Illuminate/Validation/Validator.php#L761

thats why when calling Validator::make with an empty data array then call getRules function inside the getParameters function in the AbstractGenerator.php will not get the rules with wildcard.
https://github.com/mpociot/laravel-apidoc-generator/blob/master/src/Mpociot/ApiDoc/Generators/AbstractGenerator.php#L82

Im wondering whats the benefit of creating a Validator instance and use its getRules function, when getRouteRules is returning all the rules to generate the doc already?

@jgardezi
Copy link

@jwolowski no I was not able to solve the problems. Now in my project I trying a different approach using http://swagger.io/ for API documentation. The package I have found is https://github.com/DarkaOnLine/L5-Swagger. However, I have not tried it.

@shalvah
Copy link
Contributor

shalvah commented Sep 7, 2018

This should be fixed in #299. Let us know how it goes.

@shalvah shalvah closed this as completed Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants