A CLI and programmatic tool that converts YAML specification files (OpenAPI, Swagger, AsyncAPI) into JSON Schema. Version 1.0.2 is the latest stable release, with infrequent updates. It supports both global and project-local usage via npm. Key differentiator: direct conversion from popular YAML-based API specifications to JSON Schema, enabling further processing with tools like quicktype or AJV.
npm install yaml-to-json-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates converting a YAML string and file to JSON Schema using named imports from the ESM module.
Use import syntax or dynamic import(). If using CommonJS, wrap in an async function: const { convert } = await import('yaml-to-json-schema');Pre-process YAML to dereference anchors before conversion.
Use tools like AJV to validate or adjust the schema as needed.
Change to import { convert } from 'yaml-to-json-schema'; or use dynamic import.Use named import: import { convert } from 'yaml-to-json-schema';Run npm install --save-dev yaml-to-json-schema
Ensure YAML string is valid. Use YAML lint tools to validate before conversion.
No dependency data recorded yet.