# Generated by smithplates HTTP codegen. Do not edit.
from typing import Annotated

from fastapi import (
    APIRouter,
    Depends,
    Path,
)
from pydantic import Field  # noqa: F401

from generated.petstore.api.get_category_output import GetCategoryOutput
from generated.petstore.api.petstore.api_response import dispatch_api_response
from generated.petstore.api.petstore.app_services import ApiServices, get_api_services
from generated.petstore.api.petstore.operation_bindings import OPERATION_HTTP_BINDINGS

router = APIRouter()


@router.get(
    "/categories/{categoryId}",
    responses={
        200: {"description": "Response"},
        404: {"description": "Response"},
    },
    response_model_by_alias=True,
)
async def get_category(
    services: Annotated[ApiServices, Depends(get_api_services)],
    category_id: str = Path(..., alias="categoryId"),
) -> GetCategoryOutput:
    return dispatch_api_response(
        await services.categories_api.get_category(category_id=category_id),
        OPERATION_HTTP_BINDINGS["get_category"],
    )
