File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,9 @@ def validate_schema!
5050 accept_uri : false ,
5151 accept_file : -> ( path ) { path . to_s . start_with? ( Gem . loaded_specs [ "json-schema" ] . full_gem_path ) } ,
5252 )
53- metaschema = "file://#{ JSON ::Validator . validator_for_name ( "draft4" ) . metaschema } "
53+ metaschema_path = Pathname . new ( JSON ::Validator . validator_for_name ( "draft4" ) . metaschema )
54+ metaschema_uri = URI ::File . build ( host : "" , path : metaschema_path . expand_path . cleanpath . to_s . tr ( "\\ " , "/" ) )
55+ metaschema = metaschema_uri . to_s
5456 errors = JSON ::Validator . fully_validate ( metaschema , schema , schema_reader : schema_reader )
5557 if errors . any?
5658 raise ArgumentError , "Invalid JSON Schema: #{ errors . join ( ", " ) } "
Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ def validate_schema!
4242 accept_uri : false ,
4343 accept_file : -> ( path ) { path . to_s . start_with? ( Gem . loaded_specs [ "json-schema" ] . full_gem_path ) } ,
4444 )
45- metaschema = JSON ::Validator . validator_for_name ( "draft4" ) . metaschema
45+ metaschema_path = Pathname . new ( JSON ::Validator . validator_for_name ( "draft4" ) . metaschema )
46+ metaschema_uri = URI ::File . build ( host : "" , path : metaschema_path . expand_path . cleanpath . to_s . tr ( "\\ " , "/" ) )
47+ metaschema = metaschema_uri . to_s
4648 errors = JSON ::Validator . fully_validate ( metaschema , schema , schema_reader : schema_reader )
4749 if errors . any?
4850 raise ArgumentError , "Invalid JSON Schema: #{ errors . join ( ", " ) } "
You can’t perform that action at this time.
0 commit comments