skillfed

voluptuous-openapi

Convert voluptuous schemas to OpenAPI Schema object

voluptuous-openapi v0.4.1 631.3K downloads/30d#5,659 on PyPI1
Permissive license Apache-2.0 Active released

What it is and what it does

Voluptuous OpenAPI bridges validation and API documentation by translating Voluptuous schemas—which define input validation rules—into OpenAPI 3.0 Schema objects. This eliminates the need to maintain separate schema definitions for validation and documentation; a single Voluptuous schema can drive both runtime validation and OpenAPI spec generation. The package maps Voluptuous validators (like Length, Range, Coerce) to their OpenAPI equivalents (minLength, minimum, type), preserving field descriptions and required/optional status.

The conversion is straightforward for standard validators but extensible: you can provide a custom serializer function to handle domain-specific validators that the package doesn't recognize natively. The library is lightweight, depending only on Voluptuous itself, and is actively maintained with no known security issues.

Use it for:

  • Generate OpenAPI documentation automatically from Voluptuous validation schemas in FastAPI or Flask applications.
  • Maintain a single source of truth for input validation and API contract documentation.
  • Extend API documentation tooling to projects already using Voluptuous for request/response validation.
  • Convert custom Voluptuous validators to OpenAPI constraints using a custom serializer function.
  • Reduce manual schema duplication when building REST APIs with strict validation requirements.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Converts Voluptuous validation schemas into OpenAPI 3.0 Schema objects, enabling automated API documentation generation from your validation rules.

Yes, if you use Voluptuous for validation and need OpenAPI documentation. The package is actively maintained, has no security issues, and low install friction. It solves a real problem—keeping validation and documentation in sync—with a clean, extensible design. Skip it if you don't use Voluptuous or don't need OpenAPI output.

Install

voluptuous-openapi on PyPI

pip

pip install voluptuous-openapi

uv

uv add voluptuous-openapi

poetry

poetry add voluptuous-openapi

Installing voluptuous-openapi

Before you install

Low friction: pure Python wheel with a single runtime dependency (voluptuous). Last release 49 days ago with active maintenance status and no known vulnerabilities.

License in practice

Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions.

Quickstart

pip install voluptuous-openapi

from voluptuous_openapi import convert
import voluptuous as vol

schema = vol.Schema({vol.Required('name'): str})
openapi_schema = convert(schema)

Requires Python 3.9 or later.

Verify before relying

  • Whether custom serializers handle all common Voluptuous validators or only a subset.
  • Performance characteristics when converting large or deeply nested schemas.
  • Compatibility with specific Voluptuous versions beyond the runtime dependency declaration.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 1 — voluptuous
Maintenance actively maintained — 49 days since the last release
Last repo commit
First released
Downloads 631,329/month — #5,659 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: voluptuous_openapi-0.4.1-py3-none-any.whl

Tags

voluptuous to openapi conversionopenapi schema from validationapi documentation from validatorsvoluptuous openapi generatorconvert validation schema to openapiopenapi schema object generationvoluptuous api documentation
openapi-generationschema-conversionapi-documentation

More WWW/HTTP packages