This repository has been archived on 2024-04-25. You can view files and clone it, but cannot push or open issues or pull requests.
golang-rest-example/pkg/openapi/oas_validators_gen.go

33 lines
571 B
Go
Raw Normal View History

2024-02-01 22:09:09 +00:00
// Code generated by ogen, DO NOT EDIT.
package openapi
import (
"github.com/go-faster/errors"
"github.com/ogen-go/ogen/validate"
)
func (s *Group) Validate() error {
if s == nil {
return validate.ErrNilPointer
}
var failures []validate.FieldError
if err := func() error {
2024-02-02 14:39:13 +00:00
if s.UserIds == nil {
2024-02-01 22:09:09 +00:00
return errors.New("nil is invalid value")
}
return nil
}(); err != nil {
failures = append(failures, validate.FieldError{
2024-02-02 14:39:13 +00:00
Name: "user_ids",
2024-02-01 22:09:09 +00:00
Error: err,
})
}
if len(failures) > 0 {
return &validate.Error{Fields: failures}
}
return nil
}