Essentials OpenAPI is a Python library (current version 1.4.0) designed for generating OpenAPI Documentation in both v3 and v2 formats, with output capabilities in JSON and YAML. It also provides utilities for generating other types of documents from existing OpenAPI Specification files. The project is actively maintained with a regular release cadence, often addressing bug fixes and adding support for newer OpenAPI specification versions.
pip install essentials-openapiVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to programmatically construct a minimal OpenAPI v3 specification using `essentials-openapi`. It defines API info, a basic path with a GET operation, and a response schema, then outputs the specification as JSON. This approach directly uses the library's Python classes to build the OpenAPI document structure.
Convert your Swagger (OpenAPI v2) specification to OpenAPI v3.x format before processing with `essentials-openapi`. Several online converters and tools are available for this purpose.
Users running Python 3.8 or older must upgrade their Python environment to version 3.9 or newer to use `essentials-openapi` v1.1.0 and subsequent releases.
Ensure `MarkupSafe` is explicitly installed and up-to-date (`pip install --upgrade MarkupSafe`). Older versions of `MarkupSafe` (prior to 1.1.1) can cause `ImportError: cannot import name 'Feature' from 'setuptools'` with newer `setuptools`.
While OAS 3.1 is largely backward compatible with 3.0.x, users relying on very specific 3.0.x behaviors or tooling might encounter subtle differences. Review generated specs for compatibility with downstream tools if issues arise.