voluptuous-openapi is a Python library that converts Voluptuous schemas into OpenAPI Schema objects. It is currently at version 0.3.0 and appears to have a stable, though not rapid, release cadence, with the latest release on Dec 30, 2025.
pip install voluptuous-openapi==0.3.0Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define a basic Voluptuous schema with required, optional, and type-specific validators, and then convert it into a dictionary representing an OpenAPI Schema object using `voluptuous-openapi.convert`.
Verify the OpenAPI Specification version generated by `voluptuous-openapi` and ensure it matches the target environment. Manual adjustments to the generated schema may be required for full 3.1 compliance if not natively supported.
Be aware that feature requests or complex bug fixes requiring upstream changes in `voluptuous` might have limited support. Consider contributing fixes if critical issues arise.
For OpenAPI 3.0 targets, consider workarounds like the 'allOf hack' mentioned in community discussions, or upgrade to OpenAPI 3.1 if possible, which addresses this issue.
Run `pip install voluptuous-openapi` to install the package.
Modify your `voluptuous.Schema` definition to explicitly handle extra keys. Use `vol.Schema(..., extra=vol.ALLOW_EXTRA)` to permit them, or `vol.Schema(..., extra=vol.REMOVE_EXTRA)` to silently ignore them.
Consult the `voluptuous-openapi` GitHub repository and documentation for supported OpenAPI versions and features. For complex or custom validators, explore implementing a custom serializer as described in the library's README to extend its conversion capabilities.