The `do-oas-kit-common` package provides foundational utility functions intended to support operations within the broader `oas-kit` ecosystem, which focuses on converting, validating, resolving, and linting OpenAPI (OAS) and Swagger specifications. While the provided version is 1.0.10, the `oas-kit` monorepo and its constituent packages (including `oas-resolver` and `oas-linter`) appear to have had their last significant updates approximately five years ago. This suggests the library is in a maintenance state, with no active development or new feature releases to support the latest OpenAPI specification versions (e.g., OpenAPI 3.1.x) or modern JavaScript language features. It likely includes helpers for tasks such as sanitizing schema component names, resolving internal `$ref` paths, and common error handling within the context of OpenAPI document manipulation.
npm install do-oas-kit-commonVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates sanitizing a schema name and using a unified error/warning utility, typical functions for an OpenAPI utility kit. It processes an example OpenAPI specification, sanitizes a component name, and handles potential missing schemas.
Evaluate compatibility with your target OpenAPI specification version and Node.js environment. Consider using more actively maintained alternatives if up-to-date specification support is critical.
Avoid Node.js 12.17.x-12.19.x; use a different LTS version of Node.js for running `oas-kit-common` or other `oas-kit` tools.
For older Node.js versions or mixed environments, use `const { Name } = require('do-oas-kit-common');`. For modern ESM-only projects, ensure your build setup correctly handles CJS interop or consider if this library is suitable.If running in a Node.js CJS environment, use `const { sanitise } = require('do-oas-kit-common');`. Ensure your build tools are correctly configured for CJS-ESM interop if using modern ESM syntax.Verify the exact name and path of the schema in your OpenAPI document. Use `console.log` or `debugger` to inspect the `openApiSpec` object and confirm the expected structure and naming. Ensure any necessary sanitization (e.g., via `sanitise` function) is applied before lookup.
No dependency data recorded yet.