mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 20:01:17 +00:00
[clip] Fix: Optional fields were required
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
6c941fb330
commit
b131a7be5f
1 changed files with 2 additions and 2 deletions
|
@ -111,8 +111,8 @@ func (actor) Name() string { return actorName }
|
||||||
|
|
||||||
func (actor) Validate(tplValidator plugins.TemplateValidatorFunc, attrs *fieldcollection.FieldCollection) (err error) {
|
func (actor) Validate(tplValidator plugins.TemplateValidatorFunc, attrs *fieldcollection.FieldCollection) (err error) {
|
||||||
if err = attrs.ValidateSchema(
|
if err = attrs.ValidateSchema(
|
||||||
fieldcollection.MustHaveField(fieldcollection.SchemaField{Name: "channel", NonEmpty: true, Type: fieldcollection.SchemaFieldTypeString}),
|
fieldcollection.CanHaveField(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: "creator", NonEmpty: true, Type: fieldcollection.SchemaFieldTypeString}),
|
||||||
helpers.SchemaValidateTemplateField(tplValidator, "channel", "creator"),
|
helpers.SchemaValidateTemplateField(tplValidator, "channel", "creator"),
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return fmt.Errorf("validating attributes: %w", err)
|
return fmt.Errorf("validating attributes: %w", err)
|
||||||
|
|
Loading…
Reference in a new issue