validate method

void validate()

Validate configuration for common issues

Implementation

void validate() {
  final invalidTypes = entries
      .where((entry) => !BUILTIN_TYPES.contains(entry.type))
      .toList();

  if (invalidTypes.isNotEmpty) {
    throw FormatException(
      'Invalid types found: ${invalidTypes.map((e) => e.type).join(', ')}',
    );
  }

  // Check for duplicate paths with different types
  final pathTypeMap = <String, Set<String>>{};
  for (final entry in entries) {
    pathTypeMap.putIfAbsent(entry.path, () => <String>{}).add(entry.type);
  }

  final conflicts = pathTypeMap.entries
      .where((entry) => entry.value.length > 1)
      .toList();

  if (conflicts.isNotEmpty) {
    throw FormatException(
      'Path conflicts found: ${conflicts.map((e) => '${e.key}: ${e.value.join(', ')}').join('; ')}',
    );
  }
}