(req ExecutionRequest)
| 2650 | } |
| 2651 | |
| 2652 | func normalizeTaskExecutionRequest(req ExecutionRequest) (ExecutionRequest, error) { |
| 2653 | normalized := req |
| 2654 | normalized.IdempotencyKey = strings.TrimSpace(normalized.IdempotencyKey) |
| 2655 | normalized.NetworkChannel = strings.TrimSpace(normalized.NetworkChannel) |
| 2656 | normalized.Metadata = normalizeRawJSON(normalized.Metadata) |
| 2657 | if err := normalized.Validate("task_execution"); err != nil { |
| 2658 | return ExecutionRequest{}, err |
| 2659 | } |
| 2660 | return normalized, nil |
| 2661 | } |
| 2662 | |
| 2663 | func taskExecutionIdempotencyKey(taskID string, action ExecutionAction, requested string) string { |
| 2664 | if trimmed := strings.TrimSpace(requested); trimmed != "" { |
no test coverage detected