Added event response model in api documentation

This commit is contained in:
Donkie
2023-10-15 19:46:28 +02:00
parent a6d527aaf0
commit 7a3c2e3a68
3 changed files with 9 additions and 9 deletions

View File

@@ -13,7 +13,7 @@ from pydantic import BaseModel, Field
from pydantic.error_wrappers import ErrorWrapper
from sqlalchemy.ext.asyncio import AsyncSession
from spoolman.api.v1.models import Message, Spool
from spoolman.api.v1.models import Message, Spool, SpoolEvent
from spoolman.database import spool
from spoolman.database.database import get_db_session
from spoolman.database.utils import SortOrder
@@ -250,10 +250,10 @@ async def find(
name="Get spool",
description=(
"Get a specific spool. A websocket is served on the same path to listen for changes to the spool. "
"The response model is the same for the websocket messages as for this endpoint."
"See the HTTP Response code 299 for the content of the websocket messages."
),
response_model_exclude_none=True,
responses={404: {"model": Message}},
responses={404: {"model": Message}, 299: {"model": SpoolEvent, "description": "Websocket message"}},
)
async def get(
db: Annotated[AsyncSession, Depends(get_db_session)],