openapi-route-expander
v0.0.4
Published
A utility for resolving $ref in OpenAPI YAML routes, generating new YAML files without $ref, ready for OpenAPI processing.
Downloads
91
Maintainers
Readme
OpenAPI Ref Resolver
A TypeScript utility for resolving $ref
in OpenAPI YAML routes, generating new YAML files without $ref
, ready for OpenAPI processing.
Table of Contents
Features
- $ref Resolution: Automatically resolves
$ref
within OpenAPI YAML routes. - YAML Processing: Reads and writes YAML files seamlessly.
- TypeScript Support: Fully typed and written in TypeScript.
- Easy Integration: Simple API for integrating into existing projects.
Installation
You can install the package using npm:
npm install openapi-ref-resolver
Or with yarn:
yarn add openapi-ref-resolver
Usage
Here’s an example of how to use the resolveRefsInRoutes function:
import { resolveRefsInRoutes } from 'openapi-ref-resolver';
const inputFilePath = '/absolute/path/to/your/input.yaml';
const outputFilePath = '/absolute/path/to/your/output.yaml';
resolveRefsInRoutes(inputFilePath, outputFilePath);