Пример #1
0
from app.v1.comment.schemas import CommentReplySchema, CommentSchema
from app.v1.list.resources import (
    create_list,
    delete_list_item,
    get_list_item,
    get_lists,
    update_list_item,
)
from app.v1.list.schemas import ListSchema
from app.v1.user.resources import create_user, get_user_list, login, logout
from app.v1.user.schemas import UserSchema, UserLoginSchema
from config import get_config

swagger_generator = SwaggerV3Generator(
    version="1.0.0",
    title="Irithm API V1",
    description="Sample API for Irithm Application",
)

config = get_config()
version_1_registry = HandlerRegistry(
    default_mimetype="application/json",
    prefix="/v1",
    swagger_generator=swagger_generator,
    swagger_path="/swagger" if config.DEBUG else None,
    swagger_ui_path="/swagger/ui" if config.DEBUG else None,
)
# TODO: enable auth
# authenticator = HeaderApiKeyAuthenticator(header='X-MyApp-ApiKey')
# authenticator.register_key(key='my-secret-api-key')