diff --git a/spoolman/api/v1/filament.py b/spoolman/api/v1/filament.py index ea10d43..86e76db 100644 --- a/spoolman/api/v1/filament.py +++ b/spoolman/api/v1/filament.py @@ -12,7 +12,7 @@ from pydantic import BaseModel, Field, validator from pydantic.error_wrappers import ErrorWrapper from sqlalchemy.ext.asyncio import AsyncSession -from spoolman.api.v1.models import Filament, Message +from spoolman.api.v1.models import Filament, FilamentEvent, Message from spoolman.database import filament from spoolman.database.database import get_db_session from spoolman.database.utils import SortOrder @@ -236,10 +236,10 @@ async def find( name="Get filament", description=( "Get a specific filament. A websocket is served on the same path to listen for changes to the filament. " - "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": FilamentEvent, "description": "Websocket message"}}, ) async def get( db: Annotated[AsyncSession, Depends(get_db_session)], diff --git a/spoolman/api/v1/spool.py b/spoolman/api/v1/spool.py index 2629f4a..86e6bb3 100644 --- a/spoolman/api/v1/spool.py +++ b/spoolman/api/v1/spool.py @@ -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)], diff --git a/spoolman/api/v1/vendor.py b/spoolman/api/v1/vendor.py index 3d6e649..4d70849 100644 --- a/spoolman/api/v1/vendor.py +++ b/spoolman/api/v1/vendor.py @@ -11,7 +11,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, Vendor +from spoolman.api.v1.models import Message, Vendor, VendorEvent from spoolman.database import vendor from spoolman.database.database import get_db_session from spoolman.database.utils import SortOrder @@ -104,10 +104,10 @@ async def find( name="Get vendor", description=( "Get a specific vendor. A websocket is served on the same path to listen for changes to the vendor. " - "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": VendorEvent, "description": "Websocket message"}}, ) async def get( db: Annotated[AsyncSession, Depends(get_db_session)],