dereference-json-schema
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

dereference-json-schema

CI npm version npm downloads bundle size License Buy me a coffee

Dereference $ref pointers in JSONSchema or OpenAPI documents.

Zero dependencies. Synchronous core. Handles circular refs.

Usage

npm i dereference-json-schema
import { dereferenceSync } from 'dereference-json-schema';

const schemaWithRefs = {
  schemas: {
    Person: {
      type: 'object',
      properties: {
        name: {
          $ref: '#/schemas/Name',
        },
      },
    },
    Name: {
      type: 'string',
    },
  },
};

const schemaWithNoRefs = dereferenceSync(schemaWithRefs);

Contributing

dereference-json-schema is Free and Open Source Software. Issues and pull requests are more than welcome!

Package Sidebar

Install

npm i dereference-json-schema

Weekly Downloads

36,452

Version

0.2.1

License

MIT

Unpacked Size

10.4 kB

Total Files

13

Last publish

Collaborators

  • anttiviljami