A middleware library for Express.js that provides Swagger UI and API request validation/routing based on OpenAPI 3.0 specifications. Current version 2.2.3 (as of 2023) is in maintenance mode with infrequent updates. It is a fork of the deprecated apigee-127/swagger-tools, adding OpenAPI 3 support. Key differentiators: integrates Swagger UI, request validation, and routing into one Express middleware. However, the project has limited community support and may have compatibility issues with newer Node.js versions. Alternatives include express-openapi-validator or swagger-ui-express.
npm install oas3-toolsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes an Express app with OpenAPI 3 validation, routing, and Swagger UI using oas3-tools.
Ensure body-parser is registered before calling oas3Tools.serve.
Create a fresh options object for each .serve() call.
Validate spec with swagger-cli prior to runtime.
Remove 'loglevel' from options; use console.log directly.
npm install body-parser
Use const oas3Tools = require('oas3-tools')Ensure spec object has 'openapi', 'info', and 'paths' fields.
Provide absolute or relative path to controllers directory.