Required: true not enforced for upload field in form templates

Hello! I’m using Discourse form templates for topic creation, and validation is working correctly for all field types except upload.

Despite setting validations: required: true on an upload field, users are still able to submit the form without attaching any files.

My understanding is that when an upload field has:

validations:
  required: true

…the form should prevent submission unless at least one file is uploaded. The form renders correctly. Other fields (input, textarea, tag-chooser, URL validation) enforce required as expected, but the upload field does not block submission when empty.

YAML is valid and the template loads without errors. File uploads themselves work correctly when used , so the issue appears to be specific to enforcement of required on the upload field. My YAML string for this uploads in my template looks like this:

- type: upload
id: patch-uploaded
attributes:
file_types: “.jpg, .png, .gif, .zip”
allow_multiple: true
label: “Upload your .zip”
validations:
required: true

Thanks in advance for any help!

1 Like