openapi-framework is a foundational Node.js library designed to integrate OpenAPI (formerly Swagger) specifications with various web frameworks. It abstracts away the complexities of OpenAPI specification parsing, routing, and validation, providing a flexible, framework-agnostic interface. This allows higher-level packages, such as `express-openapi` or `koa-openapi`, to build robust API servers by utilizing its core engine. The package is currently at version 12.1.3, indicating a mature and actively maintained codebase, though specific recent release cadences are not provided in the excerpt. Its primary differentiator lies in offering a reusable core for OpenAPI integration, enabling developers to adopt standard API documentation and validation patterns without being tied to a specific web server implementation.
npm install openapi-frameworkVerified import paths — ran on the pinned version, not inferred.
Demonstrates the basic initialization of the OpenApiFramework with a simple OpenAPI 3.0 specification. It illustrates how to instantiate the framework with an `apiDoc` and call its asynchronous `initialize()` method to prepare the API definition. This core setup is then consumed by framework-specific adapters.
Upgrade `openapi-framework` and any dependent framework-specific packages (e.g., `express-openapi`) to version 0.8.0 or higher to ensure parameter processing is idempotent and consistent.
Review your OpenAPI specification and framework configuration to explicitly set these vendor extensions as needed. Ensure that critical middleware (like validation or coercion) is enabled if your application depends on it.
Use `x-express-openapi-additional-middleware` at the path or operation level in your OpenAPI specification to apply custom middleware. For precise control over inheritance, set `x-express-openapi-inherit-additional-middleware: false` where you need to prevent parent-scoped middleware from applying.
Ensure `OpenApiFramework` is correctly instantiated with `new OpenApiFramework(args)` before calling `.initialize()`, and remember to `await` the `initialize()` method as it returns a Promise. Example: `const api = await new OpenApiFramework(args).initialize();`
Thoroughly review your `apiDoc` object against the official OpenAPI 3.0.0 specification. Utilize online OpenAPI validators or IDE plugins to lint and identify specific schema violations.
Provide an array for the `paths` property in your `OpenApiFramework` configuration, typically containing file paths or objects that define your API operations. If no specific paths are needed for a basic setup, explicitly provide an empty array: `paths: []`.
No dependency data recorded yet.