Class: FaradayMiddleware::OpenAPI::RequestValidator

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/faraday_middleware/openapi/request_validator.rb

Defined Under Namespace

Classes: RequestOperation

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}) ⇒ RequestValidator

Returns a new instance of RequestValidator.



10
11
12
13
14
# File 'lib/faraday_middleware/openapi/request_validator.rb', line 10

def initialize(app, options = {})
  super(app)
  schema_path = options.fetch(:schema_path)
  @schema_path = schema_path
end

Instance Method Details

#on_request(env) ⇒ Object



6
7
8
# File 'lib/faraday_middleware/openapi/request_validator.rb', line 6

def on_request(env)
  validate(env)
end