From b131a7be5f81d2788428fe5f28c8fe567d5b6393 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 4 Apr 2024 01:28:43 +0200 Subject: [PATCH] [clip] Fix: Optional fields were required Signed-off-by: Knut Ahlers --- internal/actors/clip/actor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/actors/clip/actor.go b/internal/actors/clip/actor.go index a1490f1..9f86a4d 100644 --- a/internal/actors/clip/actor.go +++ b/internal/actors/clip/actor.go @@ -111,8 +111,8 @@ func (actor) Name() string { return actorName } func (actor) Validate(tplValidator plugins.TemplateValidatorFunc, attrs *fieldcollection.FieldCollection) (err error) { if err = attrs.ValidateSchema( - fieldcollection.MustHaveField(fieldcollection.SchemaField{Name: "channel", NonEmpty: true, Type: fieldcollection.SchemaFieldTypeString}), - fieldcollection.MustHaveField(fieldcollection.SchemaField{Name: "creator", NonEmpty: true, Type: fieldcollection.SchemaFieldTypeString}), + fieldcollection.CanHaveField(fieldcollection.SchemaField{Name: "channel", NonEmpty: true, Type: fieldcollection.SchemaFieldTypeString}), + fieldcollection.CanHaveField(fieldcollection.SchemaField{Name: "creator", NonEmpty: true, Type: fieldcollection.SchemaFieldTypeString}), helpers.SchemaValidateTemplateField(tplValidator, "channel", "creator"), ); err != nil { return fmt.Errorf("validating attributes: %w", err)