Skip to content

Paired with a resolver package, readers handle the loading of $ref content. This repo contains some common readers for files, URLs, etc.

License

Notifications You must be signed in to change notification settings

stoplightio/json-ref-readers

Repository files navigation

json-ref-readers

Set of utilities for reading external json references.

Installation

yarn add @stoplight/json-ref-readers

Usage

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 },
  },
});

About

Paired with a resolver package, readers handle the loading of $ref content. This repo contains some common readers for files, URLs, etc.

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published