Minimalistic OpenAPI 3 to JSON Schema (draft 7) conversion library. v2.0.0 is pure ESM, requires Node >=14.13.1. No dependencies. Supports nullable, $ref conversion between #/definitions and #/components/schemas, const to enum, $id/$comment to x-id/x-comment. Does not resolve JSON $refs. Differentiator: zero dependencies, focused conversion without resolution.
npm install openapi-json-schemaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows bidirectional conversion between JSON Schema and OpenAPI 3 schema using the two main exports.
Use ESM imports (import ... from 'openapi-json-schema') or upgrade to Node >=14.13.1.
Resolve $refs manually before conversion if needed.
Ensure your JSON Schema input is draft 7 compatible.
Consider alternative libraries if you need full OpenAPI 3.1 support.
Convert to ESM imports or use dynamic import() with CommonJS: const { jsonSchemaToOpenApiSchema } = await import('openapi-json-schema');Change to: import { jsonSchemaToOpenApiSchema } from 'openapi-json-schema';No dependency data recorded yet.