Skip to content

Commit

Permalink
Revert auto-resolve part logic
Browse files Browse the repository at this point in the history
  • Loading branch information
killondark authored and skryukov committed Apr 28, 2024
1 parent 45da17b commit 7ba5f23
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions lib/json_skooma/keywords/core/ref.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,13 @@ class Ref < Base
self.key = "$ref"

def resolve
add_remote_source if need_to_adding?
@ref_schema = parent_schema.resolve_ref(json)
end

def evaluate(instance, result)
@ref_schema.evaluate(instance, result)
result.ref_schema = @ref_schema
end

def add_remote_source
parent_schema.registry.add_source(
pathname.dirname.to_s + "/",
JSONSkooma::Sources::Remote.new(json)
)
end

def need_to_adding?
json.start_with?("http") &&
parent_schema.registry.instance_variable_get("@uri_sources").keys.none?{ |k| json.include?(k) }
end

def pathname
Pathname.new(json)
end
end
end
end
Expand Down

0 comments on commit 7ba5f23

Please sign in to comment.