Sha256: acd6c6caed71b052b75f3ff34f7c07d62c011705804c41c98f17d43f362ddf02

Contents?: true

Size: 456 Bytes

Versions: 6

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

6 entries across 6 versions & 1 rubygems

Version Path
commonmeta-ruby-3.4.5 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.4.4 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.4.3 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.4.2 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.4.1 lib/commonmeta/schema_utils.rb
commonmeta-ruby-3.4.0 lib/commonmeta/schema_utils.rb