Module: Solarwinds::Itsm::Api::Definitions

Defined in:
lib/solarwinds/itsm/api/definitions.rb

Constant Summary collapse

LIB_DIR =
Pathname.new(File.join(__dir__, '../../..')).cleanpath.to_s
RESOLVED_DIR =
File.join(LIB_DIR, 'resolved_schema')

Class Method Summary collapse

Class Method Details

.base_schemaObject



11
12
13
14
# File 'lib/solarwinds/itsm/api/definitions.rb', line 11

def self.base_schema
  path = File.join(LIB_DIR, 'definitions/openapi.json')
  JSON.parse(File.open(path).read)
end

.resolved_schemaObject



16
17
18
# File 'lib/solarwinds/itsm/api/definitions.rb', line 16

def self.resolved_schema
  recursive_resolve(base_schema, File.join(LIB_DIR, 'definitions'))
end

.resolved_schema_pathObject



20
21
22
# File 'lib/solarwinds/itsm/api/definitions.rb', line 20

def self.resolved_schema_path
  File.join(RESOLVED_DIR, 'resolved_schema.json')
end

.write_resolved_schema(path = RESOLVED_DIR, name = 'resolved_schema.json') ⇒ Object



24
25
26
# File 'lib/solarwinds/itsm/api/definitions.rb', line 24

def self.write_resolved_schema(path = RESOLVED_DIR, name = 'resolved_schema.json')
  File.write(File.join(path, name), resolved_schema.to_json)
end