apispec-oneofschema
Plugin for apispec providing support for Marshmallow-OneOfSchema schemas
Decision gist · record as of 2026-08-14
Yes, if you use Marshmallow OneOfSchema and need to generate OpenAPI 3.0+ documentation. The plugin fills a specific gap—apispec does not natively handle OneOfSchema discriminators—and has no known vulnerabilities. The aging maintenance status is a minor concern but not a blocker for a stable, focused tool. Install if this matches your stack; skip if you don't use OneOfSchema or target earlier OpenAPI versions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires OpenAPI version 3.0.0 or greater; earlier versions do not support discriminator name-to-definition mapping.
- Low friction installation with three straightforward runtime dependencies.
- Maintenance status is aging—last release was 382 days ago—but the repository remains active and unarchived, suggesting the package is stable rather than abandoned.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing use in commercial and proprietary projects with minimal restrictions beyond attribution.
last release 2025-07-28 (382 days) · last repo commit 2025-07-28 · 12 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 237,688 downloads/mo, #8,954 on PyPI
Alternatives
Verify before relying
pip install apispec-oneofschema
from apispec import APISpec
from apispec_oneofschema import MarshmallowPlugin
from marshmallow_oneofschema import OneOfSchema
spec = APISpec(
title='Example',
version='1.0.0',
openapi_version='3.0.0',
plugins=[MarshmallowPlugin()]
)
spec.components.schema('MySchema', schema=YourOneOfSchema)- Whether the package works with current versions of apispec and marshmallow-oneofschema without breaking changes.
- Python version compatibility (requires_python is unspecified in metadata).
What it is and what it does
apispec-oneofschema is a plugin for apispec that bridges Marshmallow's OneOfSchema polymorphic type system with OpenAPI 3.0+ documentation. It automatically generates discriminator-based schema definitions in your OpenAPI spec, mapping polymorphic types to their corresponding schemas with proper references.
When you register a OneOfSchema with apispec using this plugin, it produces OpenAPI components that include a discriminator object with a propertyName and a mapping of type values to schema references. This lets API consumers understand which schema variant applies based on a discriminator field in the JSON payload, and it enables code generation tools to handle polymorphic responses correctly.
Use it for
- Document REST APIs with polymorphic request or response bodies where the type is determined by a discriminator field.
- Generate OpenAPI specs for services using Marshmallow OneOfSchema for type-safe serialization of union types.
- Enable API client generators to produce correct deserialization code for discriminator-based polymorphic types.
- Validate and document complex data models with multiple schema variants in a single endpoint.
- Integrate Marshmallow schema definitions directly into OpenAPI documentation without manual discriminator mapping.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use Marshmallow OneOfSchema and need to generate OpenAPI 3.0+ documentation.
The plugin fills a specific gap—apispec does not natively handle OneOfSchema discriminators—and has no known vulnerabilities. The aging maintenance status is a minor concern but not a blocker for a stable, focused tool. Install if this matches your stack; skip if you don't use OneOfSchema or target earlier OpenAPI versions.
Install
apispec-oneofschema on PyPI
Before you install
Low friction installation with three straightforward runtime dependencies. Maintenance status is aging—last release was 382 days ago—but the repository remains active and unarchived, suggesting the package is stable rather than abandoned.
Requires OpenAPI version 3.0.0 or greater; earlier versions do not support discriminator name-to-definition mapping.
License in practice
MIT license is permissive, allowing use in commercial and proprietary projects with minimal restrictions beyond attribution.
Quickstart
pip install apispec-oneofschema
from apispec import APISpec
from apispec_oneofschema import MarshmallowPlugin
from marshmallow_oneofschema import OneOfSchema
spec = APISpec(
title='Example',
version='1.0.0',
openapi_version='3.0.0',
plugins=[MarshmallowPlugin()]
)
spec.components.schema('MySchema', schema=YourOneOfSchema)
Verify before relying
- Whether the package works with current versions of apispec and marshmallow-oneofschema without breaking changes.
- Python version compatibility (requires_python is unspecified in metadata).
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesapispecmarshmallowmarshmallow-oneofschema |
| Maintenance | Aging 382 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 237,688 / month, #8,954 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: apispec_oneofschema-3.0.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “apispec marshmallow plugin”
- apispec-oneofschemaExtends apispec to generate OpenAPI 3.0+ documentation for…
- apispecGenerates OpenAPI specification documents from Python code,…
- flask-apispecflask-apispec decorates Flask view functions and classes to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Application Frameworks packages
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.
Install it if you're developing CLI tools, dashboards, or interactive terminal applications.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.
Install it if you need to build or connect to servers.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
See also marshmallow-oneofschema · marshmallow-fastoneofschema · apispec · apispec-webframeworks · marshmallow-jsonschema · marshmallow-polyfield · flask-apispec · dataclasses-jsonschema · voluptuous-openapi · marshmallow-mongoengine