MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / Validate

Method Validate

module/router/dto/input.go:51–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49}
50
51func (a *Create) Validate() error {
52 if a.Id == "" {
53 return errors.New("id is null")
54 }
55 a.Path = fmt.Sprintf("/%s", strings.TrimPrefix(a.Path, "/"))
56 for _, method := range a.Methods {
57 if _, ok := validMethods[method]; !ok {
58 return fmt.Errorf("method(%s) is invalid", method)
59 }
60 }
61
62 return nil
63}
64
65type Edit struct {
66 Name *string `json:"name"`

Callers 1

CreateMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected