validateConfig method

bool validateConfig(
  1. EndpointConfig config
)

Validates the loaded configuration.

Returns true if configuration is valid, false otherwise. Displays specific error messages when no json2dart files are found.

Implementation

bool validateConfig(EndpointConfig config) {
  // Check if any json2dart files were found
  if (config.json2DartPaths.isEmpty) {
    StatusHelper.failed(
      'No json2dart.yaml files found',
      suggestion: 'Create json2dart.yaml files in the json2dart directory',
      examples: [
        'Create a json2dart directory at the project root',
        'Add json2dart.yaml files with API endpoint definitions',
        'Run "morpheme json2dart" to generate initial files',
      ],
    );
    return false;
  }

  return true;
}