| 155 | } |
| 156 | |
| 157 | func collectJSONLeafPaths(prefix string, value any, paths *[]string) { |
| 158 | switch typed := value.(type) { |
| 159 | case map[string]any: |
| 160 | if len(typed) == 0 { |
| 161 | if prefix != "" { |
| 162 | *paths = append(*paths, prefix) |
| 163 | } |
| 164 | |
| 165 | return |
| 166 | } |
| 167 | |
| 168 | for key, child := range typed { |
| 169 | if strings.TrimSpace(key) == "" { |
| 170 | continue |
| 171 | } |
| 172 | |
| 173 | next := key |
| 174 | if prefix != "" { |
| 175 | next = prefix + "." + key |
| 176 | } |
| 177 | |
| 178 | collectJSONLeafPaths(next, child, paths) |
| 179 | } |
| 180 | default: |
| 181 | if prefix != "" { |
| 182 | *paths = append(*paths, prefix) |
| 183 | } |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | func splitFieldMask(mask string) []string { |
| 188 | if strings.TrimSpace(mask) == "" { |