Sha256: c9650c92009cbd74a80285d1bb68664fab833679ce17e3319f7c9b539734264c

Contents?: true

Size: 456 Bytes

Versions: 11

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.2.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

11 entries across 11 versions & 1 rubygems

Version Path
commonmeta-ruby-3.3.18 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.17 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.16 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.15 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.14 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.13 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.12 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.11 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.10 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.9 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.3.8 lib/commonmeta/schema_utils.rb