File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,10 @@ def validate_arguments(arguments)
4646 def validate_schema!
4747 check_for_refs!
4848 schema = to_h
49+ gem_path = File . realpath ( Gem . loaded_specs [ "json-schema" ] . full_gem_path )
4950 schema_reader = JSON ::Schema ::Reader . new (
5051 accept_uri : false ,
51- accept_file : -> ( path ) { path . to_s . start_with? ( Gem . loaded_specs [ "json-schema" ] . full_gem_path ) } ,
52+ accept_file : -> ( path ) { File . realpath ( path . to_s ) . start_with? ( gem_path ) } ,
5253 )
5354 metaschema_path = Pathname . new ( JSON ::Validator . validator_for_name ( "draft4" ) . metaschema )
5455 # Converts metaschema to a file URI for cross-platform compatibility
Original file line number Diff line number Diff line change @@ -51,9 +51,10 @@ def deep_transform_keys(schema, &block)
5151
5252 def validate_schema!
5353 schema = to_h
54+ gem_path = File . realpath ( Gem . loaded_specs [ "json-schema" ] . full_gem_path )
5455 schema_reader = JSON ::Schema ::Reader . new (
5556 accept_uri : false ,
56- accept_file : -> ( path ) { path . to_s . start_with? ( Gem . loaded_specs [ "json-schema" ] . full_gem_path ) } ,
57+ accept_file : -> ( path ) { File . realpath ( path . to_s ) . start_with? ( gem_path ) } ,
5758 )
5859 metaschema_path = Pathname . new ( JSON ::Validator . validator_for_name ( "draft4" ) . metaschema )
5960 # Converts metaschema to a file URI for cross-platform compatibility
You can’t perform that action at this time.
0 commit comments