File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,10 @@ 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  =  JSON ::Validator . validator_for_name ( "draft4" ) . metaschema 
53+         metaschema_path  =  Pathname . new ( JSON ::Validator . validator_for_name ( "draft4" ) . metaschema ) 
54+         # Converts metaschema to a file URI for cross-platform compatibility 
55+         metaschema_uri  =  JSON ::Util ::URI . file_uri ( metaschema_path . expand_path . cleanpath . to_s . tr ( "\\ " ,  "/" ) ) 
56+         metaschema  =  metaschema_uri . to_s 
5457        errors  =  JSON ::Validator . fully_validate ( metaschema ,  schema ,  schema_reader : schema_reader ) 
5558        if  errors . any? 
5659          raise  ArgumentError ,  "Invalid JSON Schema: #{ errors . join ( ", " ) }  " 
Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ def validate_schema!
5555          accept_uri : false , 
5656          accept_file : -> ( path )  {  path . to_s . start_with? ( Gem . loaded_specs [ "json-schema" ] . full_gem_path )  } , 
5757        ) 
58-         metaschema  =  JSON ::Validator . validator_for_name ( "draft4" ) . metaschema 
58+         metaschema_path  =  Pathname . new ( JSON ::Validator . validator_for_name ( "draft4" ) . metaschema ) 
59+         # Converts metaschema to a file URI for cross-platform compatibility 
60+         metaschema_uri  =  JSON ::Util ::URI . file_uri ( metaschema_path . expand_path . cleanpath . to_s . tr ( "\\ " ,  "/" ) ) 
61+         metaschema  =  metaschema_uri . to_s 
5962        errors  =  JSON ::Validator . fully_validate ( metaschema ,  schema ,  schema_reader : schema_reader ) 
6063        if  errors . any? 
6164          raise  ArgumentError ,  "Invalid JSON Schema: #{ errors . join ( ", " ) }  " 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments