Sha256: 62db39b24813cdd53be9ba290cb0206ba091fd136944e13e2270782fb1b7ae10

Contents?: true

Size: 457 Bytes

Versions: 1

Compression:

Stored size: 457 Bytes

Contents

# frozen_string_literal: true

require "json_schemer"
require "pathname"

module Commonmeta
  module SchemaUtils
    COMMONMETA = File.read(File.expand_path("../../resources/commonmeta_v0.10.8.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

1 entries across 1 versions & 1 rubygems

Version Path
commonmeta-ruby-3.13 lib/commonmeta/schema_utils.rb