A lightweight utility (v1.1.5, stable, infrequent releases) for recursively walking OpenAPI 3.0 schema objects and applying a callback to each subschema. Unlike general JSON-schema traversal libraries, it is optimized for OAS 3 schemas, handling only local references and providing a persistent state object for tracking recursion depth and visited nodes. Key differentiators: minimal dependencies, no external schema resolution, and a simple callback-based API for schema transformation or validation.
npm install oas-schema-walkerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates walking a nested OAS 3 schema object with a callback that modifies each schema.
Use a resolver like swagger-parser before walking, or handle $ref yourself.
Check if parent is an object before accessing properties: if (parent && parent.properties) { ... }N/A
Use: import { walkSchema } from 'oas-schema-walker'Guard parent access: if (!parent) return;
Always call getDefaultState() for a fresh walk; do not reuse state across separate walks on circular schemas.
No dependency data recorded yet.