From 534d692d68e403a24a3dc413c0383eae74eb3d4a Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 1 May 2024 15:46:03 +0200 Subject: [PATCH] fix field names --- models/forgefed/actor.go | 4 ++-- models/forgefed/nodeinfo.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models/forgefed/actor.go b/models/forgefed/actor.go index 704bd42da5..a34abc2075 100644 --- a/models/forgefed/actor.go +++ b/models/forgefed/actor.go @@ -218,9 +218,9 @@ func (s *ForgePerson) UnmarshalJSON(data []byte) error { func (s ForgePerson) Validate() []string { var result []string - result = append(result, validation.ValidateNotEmpty(string(s.Type), "type")...) + result = append(result, validation.ValidateNotEmpty(string(s.Type), "Type")...) result = append(result, validation.ValidateOneOf(string(s.Type), []any{string(ap.PersonType)}, "Type")...) - result = append(result, validation.ValidateNotEmpty(s.PreferredUsername.String(), "preferredUsername")...) + result = append(result, validation.ValidateNotEmpty(s.PreferredUsername.String(), "PreferredUsername")...) return result } diff --git a/models/forgefed/nodeinfo.go b/models/forgefed/nodeinfo.go index 19e992cfbf..a1373c6829 100644 --- a/models/forgefed/nodeinfo.go +++ b/models/forgefed/nodeinfo.go @@ -128,7 +128,7 @@ func NewNodeInfo(body []byte) (NodeInfo, error) { // Validate collects error strings in a slice and returns this func (node NodeInfo) Validate() []string { var result []string - result = append(result, validation.ValidateNotEmpty(string(node.SoftwareName), "source")...) + result = append(result, validation.ValidateNotEmpty(string(node.SoftwareName), "node.SoftwareName")...) result = append(result, validation.ValidateOneOf(node.SoftwareName, KnownSourceTypes, "node.SoftwareName")...) return result