1.0.1 • Published 8 months ago

@trojs/openapi-dereference v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

OpenAPI dereference

NPM version Coverage Quality Gate Status Bugs Code Smells Technical Debt Vulnerabilities Maintainability Rating Reliability Rating Security Rating

Dereference $ref pointers in JSONSchema or OpenAPI documents.

Zero dependencies. Synchronous core. Handles circular refs.

Installation

npm install @trojs/openapi-dereference or yarn add @trojs/openapi-dereference

Test the package

npm run test or yarn test

How to use

npm i @trojs/openapi-dereference
import { dereferenceSync } from '@trojs/openapi-dereference';

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

const schemaWithNoRefs = dereferenceSync(schemaWithRefs);
1.0.1

8 months ago

1.0.0

10 months ago

0.2.5

11 months ago

0.2.4

12 months ago

0.2.3

1 year ago

0.2.1

1 year ago

0.2.2

1 year ago

0.2.0

1 year ago