OpenAPI dereference
npm install @trojs/openapi-dereference[![NPM version][npm-image]][npm-url]  
   
  
Dereference $ref pointers in JSONSchema or OpenAPI documents.
Zero dependencies. Synchronous core. Handles circular refs.
npm install @trojs/openapi-dereference
oryarn add @trojs/openapi-dereference
npm run test
oryarn test
``javascript
npm i @trojs/openapi-dereference
`
`javascript
import { dereferenceSync } from '@trojs/openapi-dereference';
const schemaWithRefs = {
schemas: {
Person: {
type: 'object',
properties: {
name: {
$ref: '#/schemas/Name',
},
},
},
Name: {
type: 'string',
},
},
};
const schemaWithNoRefs = dereferenceSync(schemaWithRefs);
``
[npm-url]: https://www.npmjs.com/package/@trojs/openapi-dereference
[npm-image]: https://img.shields.io/npm/v/@trojs/openapi-dereference.svg