-
-
Notifications
You must be signed in to change notification settings - Fork 657
Closed
Labels
Type: QuestionNeeds clarificationNeeds clarification
Description
Package version
@adonisjs/core@6.15.2, @adonisjs/inertia@1.2.4
Describe the bug
I'm having a bizarre issue with request.validateAll where if an element in the object exceeds a certain string length, the validator doesn't populate the flashSession with the errors:
My validation:
export const assignmentValidator = vine.compile(
vine.object({
name: vine.string().trim(),
student_id: vine.number(),
category: vine.string().trim(),
status: vine.string().trim(),
learning_level: vine.number(),
due_date: vine.string().trim(),
source_content: vine.string().trim().nullable().optional(),
source_file: vine.string().trim().nullable().optional(),
instructions: vine.string().trim(),
instructions_notes: vine.string().trim().nullable(),
score_pass: vine.number(),
})
)
If I send source_content with a string length longer than 2403, it never populates the flashSession with any errors, anything less is fine.
Any ideas? - My bodyParser config is set to 60 MB on all types.
PLEASE NOTE: If I wrap the request.validateUsing() in a try / catch I get the following when clearing the name field and submitting - so the validation is working - it's just not populating the flashSession for some reason:
{
status: 422,
code: 'E_VALIDATION_ERROR',
messages: [
{
message: 'The name field must be defined',
rule: 'required',
field: 'name'
}
]
}
Metadata
Metadata
Assignees
Labels
Type: QuestionNeeds clarificationNeeds clarification