
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
essentials-openapi
Advanced tools
Classes to generate OpenAPI Documentation v3 and v2, in JSON and YAML, and to generate other kinds of documents from OpenAPI Documentation files.
pip install essentials-openapi
To install with dependencies to generate other kinds of artifacts from source OpenAPI Documentation files:
pip install essentials-openapi[full]
This library has been originally created to implement generation of OpenAPI Documentation
in the BlackSheep web framework.
However, this package is abstracted from that web framework and can be reused for other
applications. Today this library also offers functions to generate documentation from
source OpenAPI Documentation files.
These require the full package: install it using pip install essentials-openapi[full].
To generate output for MkDocs and PyMdown extentions:
oad gen-docs -s example1-openapi.json -d output.md

Example of MkDocs documentation generated using Neoteroi/mkdocs-plugins.
To generate a PlantUML class diagram of the components schemas:
oad gen-docs -s source-openapi.json -d schemas.wsd --style "PLANTUML_SCHEMAS"

Example of PlantUML diagram generated from components schemas.
To generate a PlantUML class diagram with an overview of API endpoints:
oad gen-docs -s source-openapi.json -d schemas.wsd --style "PLANTUML_API"

Example of PlantUML diagram generated from path items.
You can override the default templates by providing a custom templates directory:
oad gen-docs -s source-openapi.json -d output.md -T ./my-templates/
The custom templates directory should contain template files with the same names as the built-in templates. Any template file found in the custom directory will override the corresponding default template, while non-overridden templates will use the defaults. This follows the same pattern as MkDocs template customization.
Important: The custom templates directory must match the output style being rendered. Each style (MKDOCS, MARKDOWN, PLANTUML_SCHEMAS, PLANTUML_API) has its own template structure. You need to provide templates appropriate for the --style parameter you're using.
Template structure:
layout.html - Main layout templatepartial/ - Directory containing reusable template componentsExample custom template directory structure:
my-templates/
├── layout.html # Overrides main layout
└── partial/
├── info.html # Overrides info section
└── path-items.html # Overrides path items section
All templates use Jinja2 syntax and have access to the same filters, functions, and context variables as the built-in templates.
style, allow_reserved, explode are not
handled.| Style | Int value | Description |
|---|---|---|
| MKDOCS | 1 | Markdown for MkDocs and PyMdown extensions. |
| MARKDOWN | 2 | Basic Markdown. |
| HTML | 3 | Plain HTML (planned, not yet implemented). |
| PLANTUML_SCHEMAS | 100 | PlantUML schema for components schemas. |
| PLANTUML_API | 101 | PlantUML schema for API endpoints. |
| Source | Example |
|---|---|
| YAML file | ./docs/swagger.yaml |
| JSON file | ./docs/swagger.json |
| URL returning YAML on HTTP GET | https://example-domain.net/swagger/v1/swagger.yaml |
| URL returning JSON on HTTP GET | https://example-domain.net/swagger/v1/swagger.json |
FAQs
Classes to generate OpenAPI Documentation v3 and v2, in JSON and YAML.
We found that essentials-openapi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.