mirror of
1
Fork 0

fix field names

This commit is contained in:
Michael Jerger 2024-05-01 15:46:03 +02:00
parent 715ff0eb7f
commit 534d692d68
2 changed files with 3 additions and 3 deletions

View File

@ -218,9 +218,9 @@ func (s *ForgePerson) UnmarshalJSON(data []byte) error {
func (s ForgePerson) Validate() []string { func (s ForgePerson) Validate() []string {
var result []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.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 return result
} }

View File

@ -128,7 +128,7 @@ func NewNodeInfo(body []byte) (NodeInfo, error) {
// Validate collects error strings in a slice and returns this // Validate collects error strings in a slice and returns this
func (node NodeInfo) Validate() []string { func (node NodeInfo) Validate() []string {
var result []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")...) result = append(result, validation.ValidateOneOf(node.SoftwareName, KnownSourceTypes, "node.SoftwareName")...)
return result return result