(req contract.MemoryCreateRequest)
| 2084 | } |
| 2085 | |
| 2086 | func validateMemoryCreateRequest(req contract.MemoryCreateRequest) error { |
| 2087 | if err := req.Type.Validate(); err != nil { |
| 2088 | return NewMemoryValidationError(err) |
| 2089 | } |
| 2090 | if strings.TrimSpace(req.Name) == "" { |
| 2091 | return NewMemoryValidationError(errors.New("name is required")) |
| 2092 | } |
| 2093 | if strings.TrimSpace(req.Content) == "" { |
| 2094 | return NewMemoryValidationError(errors.New("content is required")) |
| 2095 | } |
| 2096 | return nil |
| 2097 | } |
| 2098 | |
| 2099 | func (h *BaseHandlers) memoryCandidateFromCreate( |
| 2100 | selector memorySelector, |
no test coverage detected