mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-25 11:16:11 +01:00
fix field names
This commit is contained in:
parent
715ff0eb7f
commit
534d692d68
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue