1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

API: Updated docs with consistent types, fixed users response example

For #5178 and #5183
This commit is contained in:
Dan Brown
2024-08-27 12:23:36 +01:00
parent 9f68ca5358
commit 1f2506221a
3 changed files with 11 additions and 12 deletions

View File

@@ -171,16 +171,16 @@ class AttachmentApiController extends ApiController
{
return [
'create' => [
'name' => ['required', 'min:1', 'max:255', 'string'],
'name' => ['required', 'string', 'min:1', 'max:255'],
'uploaded_to' => ['required', 'integer', 'exists:pages,id'],
'file' => array_merge(['required_without:link'], $this->attachmentService->getFileValidationRules()),
'link' => ['required_without:file', 'min:1', 'max:2000', 'safe_url'],
'link' => ['required_without:file', 'string', 'min:1', 'max:2000', 'safe_url'],
],
'update' => [
'name' => ['min:1', 'max:255', 'string'],
'name' => ['string', 'min:1', 'max:255'],
'uploaded_to' => ['integer', 'exists:pages,id'],
'file' => $this->attachmentService->getFileValidationRules(),
'link' => ['min:1', 'max:2000', 'safe_url'],
'link' => ['string', 'min:1', 'max:2000', 'safe_url'],
],
];
}