Class: RspecApiDocumentation::Writers::OpenApiJsonWriter

Inherits:
OpenApiWriter
  • Object
show all
Defined in:
lib/rspec_api_documentation/writers/open_api_json_writer.rb

Instance Attribute Summary

Attributes inherited from OpenApiWriter

#swagger, #types

Instance Method Summary collapse

Methods inherited from OpenApiWriter

#configs, #default_configs, #defined_configs, #get_hash, #get_properties, #hash_deep_assign, #info, #servers

Instance Method Details

#writeObject



4
5
6
7
8
# File 'lib/rspec_api_documentation/writers/open_api_json_writer.rb', line 4

def write
  File.open(configuration.docs_dir.join('open_api.json'), 'w') do |f|
    f.write JSON.pretty_generate(get_hash)
  end
end