Sha256: a2f46151f91266de8c0c993905fb401fefa5bc68db7d52ed8debf38ef2070a29

Contents?: true

Size: 648 Bytes

Versions: 10

Compression:

Stored size: 648 Bytes

Contents

require_relative "json_schema/document_store"
require_relative "json_schema/parser"
require_relative "json_schema/reference_expander"
require_relative "json_schema/schema"
require_relative "json_schema/schema_error"
require_relative "json_schema/validator"

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

  def self.parse!(data)
    schema = Parser.new.parse!(data)
    schema.expand_references!
    schema
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
json_schema-0.0.18 lib/json_schema.rb
json_schema-0.0.17 lib/json_schema.rb
json_schema-0.0.16 lib/json_schema.rb
json_schema-0.0.15 lib/json_schema.rb
json_schema-0.0.14 lib/json_schema.rb
json_schema-0.0.13 lib/json_schema.rb
json_schema-0.0.12 lib/json_schema.rb
json_schema-0.0.11 lib/json_schema.rb
json_schema-0.0.10 lib/json_schema.rb
json_schema-0.0.9 lib/json_schema.rb