class Apivore::CustomSchemaValidator
Constants
- WF_SCHEMA
This constant is an example custom schema included with the gem
Public Class Methods
new(custom_schema)
click to toggle source
# File lib/apivore/custom_schema_validator.rb, line 6 def initialize(custom_schema) @schema = custom_schema end
Public Instance Methods
description()
click to toggle source
# File lib/apivore/custom_schema_validator.rb, line 15 def description "additionally conforms to #{@schema}" end
failure_message()
click to toggle source
# File lib/apivore/custom_schema_validator.rb, line 19 def failure_message @results.join("\n") end
matches?(swagger_checker)
click to toggle source
# File lib/apivore/custom_schema_validator.rb, line 10 def matches?(swagger_checker) @results = JSON::Validator.fully_validate(@schema, swagger_checker.swagger) @results.empty? end