swagger-walker
v0.0.3
Published
NodeJS utility to help work with Swagger Spec
Downloads
5
Maintainers
Readme
swagger-walker
NodeJS utility to help work with Swagger Spec
It eats any version and format of Swagger schema and return strict internal Swagger schema representation
Usage
- Install
npm i -D swagger-walker
- Usage
import { createSwaggerWalker } from "swagger-walker";
// ...somewhere
const walker = await createSwaggerWalker({
path: PATH_TO_YOUR_SWAGGER_SCHEMA, // optional
url: URL_TO_YOUR_SWAGGER_SCHEMA; // optional
spec: JS_OBJECT_SWAGGER_SCHEMA; // optional
})
if (!walker) {
walker.components.schemas.find(/* do something */)
}