Class: AppMap::Command::AgentSetup::Validate

Inherits:
ValidateStruct show all
Defined in:
lib/appmap/command/agent_setup/validate.rb

Instance Attribute Summary

Attributes inherited from ValidateStruct

#config_file

Instance Method Summary collapse

Instance Method Details

#performObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/appmap/command/agent_setup/validate.rb', line 12

def perform
  schema_path = File.expand_path('../../../../../config-schema.yml', __FILE__)
  schema = YAML.safe_load(File.read(schema_path))
  result = {
    version: 2,
    errors: config_validator.violations.map(&:to_h),
    schema: schema
  }
  puts JSON.pretty_generate(result)
end