Module: JsonSchema

Defined in:
lib/json_schema.rb,
lib/json_schema/error.rb,
lib/json_schema/parser.rb,
lib/json_schema/schema.rb,
lib/json_schema/validator.rb,
lib/json_schema/attributes.rb,
lib/json_schema/configuration.rb,
lib/json_schema/document_store.rb,
lib/json_schema/reference_expander.rb

Defined Under Namespace

Modules: Attributes, ErrorFormatter Classes: AggregateError, Configuration, DocumentStore, Error, Parser, ReferenceExpander, Schema, SchemaError, ValidationError, Validator

Class Method Summary collapse

Class Method Details

.configurationObject



15
16
17
# File 'lib/json_schema.rb', line 15

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



11
12
13
# File 'lib/json_schema.rb', line 11

def self.configure
  yield configuration
end

.parse(data) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/json_schema.rb', line 19

def self.parse(data)
  parser = Parser.new
  if schema = parser.parse(data)
    [schema, nil]
  else
    [nil, parser.errors]
  end
end

.parse!(data) ⇒ Object



28
29
30
# File 'lib/json_schema.rb', line 28

def self.parse!(data)
  Parser.new.parse!(data)
end