Skip to content

Commit 7a3ffc3

Browse files
authored
Remote $ref must be fetched too for bot schema rendering (#2472)
1 parent 8fde0ea commit 7a3ffc3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/components/CondaForgeYmlSchema/index.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ export default function CondaForgeYmlSchema({ toc = null }) {
2020
},
2121
})
2222
.then((response) => response.json())
23-
.then((rawSchema) => new Resolver().resolve(rawSchema, {}))
23+
.then((rawSchema) => new Resolver({
24+
resolvers: {
25+
// this resolver will be invoked for refs with the https protocol
26+
https: {
27+
async resolve(ref) {
28+
return fetch(ref).then((response) => response.json())
29+
}
30+
}
31+
}}).resolve(rawSchema, {}))
2432
.then((resolved) => {
2533
setSchema(resolved.result);
2634
setResolved(true);

0 commit comments

Comments
 (0)