-
-
Notifications
You must be signed in to change notification settings - Fork 285
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
Form request body parameters for arrays #674
Comments
Hmm. Scribe should be able to handle this as is, but try adding a validation for the second level: 'test_questions' => 'array',
+ 'test_questions.*' => 'array',
'test_questions.*.sync_id' => 'nullable|string',
'test_questions.*.score' => 'required|int',
'test_questions.*.answers' => 'array',
'test_questions.*.answers.*.value' => 'nullable|int',
'test_questions.*.answers.*.correct' => 'required|boolean' |
Thanks @shalvah that seemed to do the trick. I'd also like to know how I can write a description and example for the fields within the array from the bodyParameters function in the form request. I've tried this but no success, and also setting key to include the '*'
|
For anyone else having trouble working this out the solution was:
|
Scribe version
4.19.0
Your question
I can't seem to see any documentation or work out how I can write description and examples for properties inside an array in a form request?
Here's an example of my rules
Screenshot of output
![Screenshot 2023-05-28 at 18 50 32](https://private-user-images.githubusercontent.com/32837730/241577632-34590f74-df6c-4422-8e30-ea2a42b842d9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE3NTE0NDIsIm5iZiI6MTcyMTc1MTE0MiwicGF0aCI6Ii8zMjgzNzczMC8yNDE1Nzc2MzItMzQ1OTBmNzQtZGY2Yy00NDIyLThlMzAtZWEyYTQyYjg0MmQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzIzVDE2MTIyMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRjM2U3MjU4ODNmZWE2MDgxMjEyOTZmM2IyNzkwZmZjNmExZTgxZWU4ZjU0ZmY4MzgxNWRjYzM5ZmYwNDI4ZDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.e5h8ikE3yIIvypuF5B9MVluqKbM91491GngpIlZlhx8)
Docs
The text was updated successfully, but these errors were encountered: