mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-21 08:31:27 -05:00
fix field names
This commit is contained in:
parent
715ff0eb7f
commit
534d692d68
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue