Verified Commit 3c7b553f authored by Hercules Merscher's avatar Hercules Merscher 🌴
Browse files

chore: Replacing json-schema gem by json_schemer

parent 7a4d374b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
  spec.add_runtime_dependency "grpc", ">= 1.62" # Be sure to update the "grpc-tools" dev_dependency too
  spec.add_runtime_dependency "google-protobuf", "~> 3" # Keep the major version to 3 until we update the `grpc` gem
  spec.add_runtime_dependency "jaeger-client", "~> 1.1.0"
  spec.add_runtime_dependency 'json-schema', '~> 5.1'
  spec.add_runtime_dependency 'json_schemer', '~> 2.4.0'
  spec.add_runtime_dependency "opentracing", "~> 0.4"
  spec.add_runtime_dependency "pg_query", ">= 6.1.0", "< 7.0"
  spec.add_runtime_dependency "prometheus-client-mmap", "~> 1.2.9"
+3 −3
Original line number Diff line number Diff line
# frozen_string_literal: true

require 'forwardable'
require 'json-schema'
require 'json_schemer'
require 'pathname'
require 'yaml'

@@ -77,8 +77,8 @@ module Labkit
        content = YAML.safe_load(file_path.read)
        return nil unless content.is_a?(Hash)

        errors = JSON::Validator.fully_validate(schema, content)
        return Definition.new(user_experience_id: experience_id, **content) if errors.empty?
        schemer = JSONSchemer.schema(schema)
        return Definition.new(user_experience_id: experience_id, **content) if schemer.valid?(content)

        warn("Invalid schema for #{file_path}")