We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use in this format:
router = APIRouter() router.get("/users")(get_users) def get_users(): # function logic here
Looked up all examples and could not find...
The text was updated successfully, but these errors were encountered:
This should work...
from typing import List, Any, Dict from fastapi import FastAPI, APIRouter from pydantic import BaseModel from fastapi_versionizer.versionizer import Versionizer, api_version app = FastAPI( title='test', docs_url='/swagger', openapi_url='/api_schema.json', redoc_url=None, description='Simple example of FastAPI Versionizer.', terms_of_service='https://github.com/alexschimpf/fastapi-versionizer' ) items_router = APIRouter( prefix='/items', tags=['Items'] ) @api_version(1) def get_items_v1() -> str: return 'v1' @api_version(2) def get_items_v2() -> str: return 'v2' items_router.get('', deprecated=True)(get_items_v1) items_router.get('')(get_items_v2) app.include_router(items_router) versions = Versionizer( app=app, prefix_format='/v{major}', semantic_version_format='{major}', latest_prefix='/latest', include_versions_route=True, sort_routes=True ).versionize()
Sorry, something went wrong.
No branches or pull requests
How to use in this format:
Looked up all examples and could not find...
The text was updated successfully, but these errors were encountered: