Class: RSpec::OpenAPI::SchemaFile

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/openapi/schema_file.rb

Overview

TODO: Support JSON

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ SchemaFile

Returns a new instance of SchemaFile.

Parameters:

  • path (String)


10
11
12
# File 'lib/rspec/openapi/schema_file.rb', line 10

def initialize(path)
  @path = path
end

Instance Method Details

#edit(&block) ⇒ Object



14
15
16
17
18
19
# File 'lib/rspec/openapi/schema_file.rb', line 14

def edit(&block)
  spec = read
  block.call(spec)
ensure
  write(RSpec::OpenAPI::KeyTransformer.stringify(spec))
end