File tree 1 file changed +8
-4
lines changed 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -76,18 +76,22 @@ impl SchemaResolver for DefaultResolver {
76
76
) -> Result < Arc < Value > , SchemaResolverError > {
77
77
match url. scheme ( ) {
78
78
"http" | "https" => {
79
- #[ cfg( all ( feature = "reqwest " , not ( feature = "resolve-http" ) ) ) ]
79
+ #[ cfg( not ( any ( feature = "resolve-http " , all ( feature= "reqwest" , feature= "rustls" ) , test ) ) ) ]
80
80
{
81
- compile_error ! ( "the `reqwest` feature does not enable HTTP schema resolving anymore, use the `resolve-http` feature instead" ) ;
81
+ compile_error ! (
82
+ r#"the `reqwest` feature alone does not enable HTTP schema resolving anymore.
83
+ Use the `resolve-http` feature which enables `native-tls` as well;
84
+ or both `reqwest` and `rustls` features together, if you prefer rustls."#
85
+ ) ;
82
86
}
83
87
84
- #[ cfg( any( feature = "resolve-http" , test) ) ]
88
+ #[ cfg( any( feature = "resolve-http" , all ( feature= "reqwest" , feature= "rustls" ) , test) ) ]
85
89
{
86
90
let response = reqwest:: blocking:: get ( url. as_str ( ) ) ?;
87
91
let document: Value = response. json ( ) ?;
88
92
Ok ( Arc :: new ( document) )
89
93
}
90
- #[ cfg( not( any( feature = "resolve-http" , test) ) ) ]
94
+ #[ cfg( not( any( feature = "resolve-http" , all ( feature= "reqwest" , feature= "rustls" ) , test) ) ) ]
91
95
Err ( anyhow:: anyhow!( "`resolve-http` feature or a custom resolver is required to resolve external schemas via HTTP" ) )
92
96
}
93
97
"file" => {
You can’t perform that action at this time.
0 commit comments