Class: RspecApiDocumentation::Writers::OpenApiWriter

Inherits:
Writer
  • Object
show all
Defined in:
lib/rspec_api_documentation/writers/open_api_writer.rb

Constant Summary collapse

FILENAME =
'open_api'

Instance Attribute Summary

Attributes inherited from Writer

#configuration, #index

Instance Method Summary collapse

Methods inherited from Writer

clear_docs, #initialize, write

Constructor Details

This class inherits a constructor from RspecApiDocumentation::Writers::Writer

Instance Method Details

#write ⇒ Object



11
12
13
14
15
# File 'lib/rspec_api_documentation/writers/open_api_writer.rb', line 11

def write
  File.open(docs_dir.join("#{FILENAME}.json"), 'w+') do |f|
    f.write Formatter.to_json(OpenApiIndex.new(index, configuration, load_config))
  end
end