-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
Hi, given that external refs are not supported, i've tested out a local setup in which the only change im doing is adjusting the loadUrl
functionality such that it utilises json-refs library. for which all references are resolved.
Old Code
private loadUrl(url: string): void {
fetch(url)
.then(resp => resp.json())
.then(schema => this.setState({ result: { schema, currentUrl: url } }))
.catch(e => this.setState({ result: { currentUrl: url, schema: { message: e.message }}}));
}
New Code
private loadUrl(url: string): void {
jsonRefs.resolveRefsAt(url).then((result) =>
this.setState({ result: { schema: result.resolved as JsonSchema, currentUrl: url } })
).catch(e => this.setState({ result: { currentUrl: url, schema: { message: e.message }}}));
}
would such a PR be accepted?
maybe utilising a toggle in the homepage wether refs should be resolved or not, would switch between the two ?
Metadata
Metadata
Assignees
Labels
No labels