(result gjson.Result, field string)
| 240 | } |
| 241 | |
| 242 | func getJSONStringValue(result gjson.Result, field string) (string, error) { |
| 243 | if !result.Exists() || result.Type == gjson.Null { |
| 244 | return "", nil |
| 245 | } |
| 246 | if result.Type != gjson.String { |
| 247 | return "", fmt.Errorf("field %s must be a string", field) |
| 248 | } |
| 249 | return result.String(), nil |
| 250 | } |
| 251 | |
| 252 | func getModelRequest(c *gin.Context) (*ModelRequest, bool, error) { |
| 253 | var modelRequest ModelRequest |
no test coverage detected