ParseInputDefinitions parses a map of input definitions from a frontmatter map. Returns a map of input name to InputDefinition.
(inputsMap map[string]any)
| 69 | // ParseInputDefinitions parses a map of input definitions from a frontmatter map. |
| 70 | // Returns a map of input name to InputDefinition. |
| 71 | func ParseInputDefinitions(inputsMap map[string]any) map[string]*InputDefinition { |
| 72 | if inputsMap == nil { |
| 73 | return nil |
| 74 | } |
| 75 | |
| 76 | result := make(map[string]*InputDefinition) |
| 77 | |
| 78 | for inputName, inputValue := range inputsMap { |
| 79 | if inputConfig, ok := inputValue.(map[string]any); ok { |
| 80 | result[inputName] = ParseInputDefinition(inputConfig) |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | inputsLog.Printf("Parsed %d input definitions", len(result)) |
| 85 | return result |
| 86 | } |