File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed
Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -51,12 +51,10 @@ def validate_schema!
5151 accept_uri : false ,
5252 accept_file : -> ( path ) { path . to_s . start_with? ( Gem . loaded_specs [ "json-schema" ] . full_gem_path ) } ,
5353 )
54- # Get the metaschema for the draft4 validator
5554 metaschema_path = Pathname . new ( JSON ::Validator . validator_for_name ( "draft4" ) . metaschema )
56- # Converts metaschema to a file URI for Windows compatibility
55+ # Converts metaschema to a file URI for cross-platform compatibility
5756 metaschema_uri = JSON ::Util ::URI . file_uri ( metaschema_path . expand_path . cleanpath . to_s . tr ( "\\ " , "/" ) )
5857 metaschema = metaschema_uri . to_s
59- # Validates the input returning any errors
6058 errors = JSON ::Validator . fully_validate ( metaschema , schema , schema_reader : schema_reader )
6159 if errors . any?
6260 raise ArgumentError , "Invalid JSON Schema: #{ errors . join ( ", " ) } "
Original file line number Diff line number Diff line change @@ -42,12 +42,10 @@ 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- # Get the metaschema for the draft4 validator
4645 metaschema_path = Pathname . new ( JSON ::Validator . validator_for_name ( "draft4" ) . metaschema )
47- # Converts metaschema to a file URI for Windows compatibility
46+ # Converts metaschema to a file URI for cross-platform compatibility
4847 metaschema_uri = JSON ::Util ::URI . file_uri ( metaschema_path . expand_path . cleanpath . to_s . tr ( "\\ " , "/" ) )
4948 metaschema = metaschema_uri . to_s
50- # Validates the output returning any errors
5149 errors = JSON ::Validator . fully_validate ( metaschema , schema , schema_reader : schema_reader )
5250 if errors . any?
5351 raise ArgumentError , "Invalid JSON Schema: #{ errors . join ( ", " ) } "
You can’t perform that action at this time.
0 commit comments