skillfed

openapi-pydantic

Pydantic OpenAPI schema implementation

openapi-pydantic Permissive license MIT AGING 122 v0.5.1 released

Install

openapi-pydantic on PyPI

pip

pip install openapi-pydantic

uv

uv add openapi-pydantic

poetry

poetry add openapi-pydantic

Package facts

License MIT (permissive)
Python support supports the current Python release (<4.0,>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — pydantic
Maintenance aging — 582 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: openapi_pydantic-0.5.1-py3-none-any.whl

Keywords: openapi, schema, parser, pydantic, validation

Framework :: PydanticLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

About openapi-pydantic

from the package's own PyPI description — quoted content, verbatim

openapi-pydantic

PyPI (image) PyPI - License (image)

OpenAPI schema implemented in Pydantic. Both Pydantic 1.8+ and 2.x are supported.

The naming of the classes follows the schema in OpenAPI specification.

> This library is forked from OpenAPI Schema Pydantic (at version 1.2.4) which is no longer actively maintained.

Installation

pip install openapi-pydantic

Try me

```python from openapi_pydantic import OpenAPI, Info, PathItem, Operation, Response

Construct OpenAPI by pydantic objects

open_api = OpenAPI( info=Info( title="My own API", version="v0.0.1", ), paths={ "/ping": PathItem( get=Operation( responses={ "200":...

Read as markdown · JSON record · Source repository · Homepage

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

Provides Pydantic data models for the OpenAPI 3.1.1 specification, enabling programmatic construction, validation, and serialization of OpenAPI schemas with full support for Pydantic 1.8+ and 2.x.

Low friction: pure Python wheel with a single runtime dependency on pydantic. Last release was recent (2025-01-08), though the project shows aging maintenance signals with 582 days since prior release.

MIT license permits unrestricted use, modification, and distribution in both open and proprietary projects with minimal obligations beyond attribution.

Usage

pip install openapi-pydantic

from openapi_pydantic import OpenAPI, Info, PathItem, Operation, Response

open_api = OpenAPI(
    info=Info(title="My API", version="v1.0.0"),
    paths={"/ping": PathItem(get=Operation(responses={"200": Response(description="pong")}))}
)
print(open_api.model_dump_json(by_alias=True, exclude_none=True))

Requires Python 3.8–3.12 and pydantic 1.8+. For Pydantic 1.x, use .json() instead of .model_dump_json().

Verdict: A stable, low-friction library for working with OpenAPI schemas as typed Pydantic objects. No known vulnerabilities and permissive licensing make it safe to adopt. Maintenance has slowed but the project remains active and compatible with current Pydantic versions.

Needs verification

  • Whether the 582-day gap between releases reflects deliberate stability or reduced active development
  • Completeness of OpenAPI 3.1.1 specification coverage relative to the full OpenAPI standard
openapi schema pydantic modelsopenapi specification validationpydantic openapi generatoropenapi 3.1 schema builderapi documentation pydanticopenapi json schemarest api spec pydantic

Similar packages