Class: KrakendOpenAPI::ImportCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/import.rb

Overview

Import Command

Instance Method Summary collapse

Constructor Details

#initialize(spec:, config:) ⇒ ImportCommand

Returns a new instance of ImportCommand.



13
14
15
16
# File 'lib/commands/import.rb', line 13

def initialize(spec:, config:)
  @spec = spec
  @importer_config = config ? YamlReader.new(config).read : {}
end

Instance Method Details

#executeObject



18
19
20
21
22
# File 'lib/commands/import.rb', line 18

def execute
  paths = OA3Reader.new(@spec).paths
  endpoints = OA3ToKrakendTransformer.new(paths, @importer_config).transform_paths
  KrakendWriter.new(endpoints, @importer_config).write
end