Package Exports
- @stoplight/json-ref-readers
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@stoplight/json-ref-readers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
json-ref-readers
Set of utilities for reading external json references.
Installation
yarn add @stoplight/json-ref-readersUsage
The library exports two functions: resolveHttp and resolveFile. Both take uri.URI and resolve to a string containing requested resource.
import { Resolver } from '@stoplight/json-ref-resolver';
import { resolveFile, resolveHttp } from '@stoplight/json-ref-readers';
const httpAndFileResolver = new Resolver({
resolvers: {
https: { resolve: resolveHttp },
http: { resolve: resolveHttp },
file: { resolve: resolveFile },
},
});