Skip to content

Commit

Permalink
minor refactor Validation::Ref#internal_validate_ref
Browse files Browse the repository at this point in the history
  • Loading branch information
notEthan committed May 23, 2023
1 parent df81043 commit 2717554
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/jsi/schema/validation/ref.rb
Expand Up @@ -10,7 +10,9 @@ def internal_validate_ref(result_builder, throw_result: false)
value = schema_content['$ref']

if value.respond_to?(:to_str)
schema_ref = jsi_memoize(:ref) { Schema::Ref.new(value, self) }
schema_ref = jsi_memoize(:validation_ref) do
Schema::Ref.new(value, self)
end

if result_builder.visited_refs.include?(schema_ref)
result_builder.schema_error('self-referential schema structure', '$ref')
Expand Down

0 comments on commit 2717554

Please sign in to comment.