Sha256: e8d67f19c34fbd582998d4fa0c3bdbac6ef5a26e5329100babdf7050000397ea

Contents?: true

Size: 456 Bytes

Versions: 32

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

require "json_schemer"
require "pathname"

module Commonmeta
  module SchemaUtils
    COMMONMETA = File.read(File.expand_path("../../resources/commonmeta_v0.9.1.json",
                                            __dir__))

    def json_schema_errors
      schemer = JSONSchemer.schema(COMMONMETA)
      errors = schemer.validate(meta).to_a
      errors.map { |err| JSONSchemer::Errors.pretty err }.presence
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
commonmeta-ruby-3.3.7 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.6 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.5 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.4 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.3 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.2 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.1 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.2.15 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.2.14 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.2.13 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.2.12 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.2.11 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.2.10 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.2.9 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.2.8 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.2.7 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.2.6 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.2.5 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.2.4 lib/commonmeta/schema_utils.rb