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 @@ -25,7 +25,7 @@ boon = "0.6"
25
25
glob = " 0.3"
26
26
proptest = " 1"
27
27
regex = " 1.10"
28
- rstest = " 0.21 "
28
+ rstest = " 0.22 "
29
29
30
30
[features ]
31
31
default = [" cloudevents" ]
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ impl EventsSchemas {
20
20
let mut mapping = HashMap :: new ( ) ;
21
21
22
22
//HACK to resolve invalid `$ref: "/schema/links/embeddedlinksarray.json"`
23
- compiler. register_url_loader ( "https" , Box :: new ( HackUrlLoader { } ) ) ;
23
+ compiler. use_loader ( Box :: new ( HackUrlLoader { } ) ) ;
24
24
25
25
for entry in glob ( "../cdevents-specs/*/schemas/*.json" ) . expect ( "Failed to read glob pattern" ) {
26
26
let schemapath = entry. unwrap ( ) ;
@@ -66,6 +66,10 @@ impl UrlLoader for HackUrlLoader {
66
66
let path = url. replace ( "https://cdevents.dev/schema" , "../cdevents-specs/spec-v0.4/schemas/" ) ;
67
67
let jsonschema: serde_json:: Value = serde_json:: from_str ( & std:: fs:: read_to_string ( path) ?) ?;
68
68
Ok ( jsonschema)
69
+ } else if url. starts_with ( "file://" ) {
70
+ let path = url. replace ( "file://" , "" ) ;
71
+ let jsonschema: serde_json:: Value = serde_json:: from_str ( & std:: fs:: read_to_string ( path) ?) ?;
72
+ Ok ( jsonschema)
69
73
} else {
70
74
Err ( format ! ( "fail to load {url}" ) . into ( ) )
71
75
}
You can’t perform that action at this time.
0 commit comments