Skip to content
Snippets Groups Projects
Commit 3c3ad802 authored by Chris Pastl's avatar Chris Pastl
Browse files

Merge branch 'api-docs-descriptions-211' into 'main'

Add custom examples to playout endpoint

See merge request !50
parents 95998809 51739967
No related branches found
No related tags found
1 merge request!50Add custom examples to playout endpoint
Pipeline #8256 passed
...@@ -25,6 +25,7 @@ from textwrap import dedent ...@@ -25,6 +25,7 @@ from textwrap import dedent
from django_filters.rest_framework import DjangoFilterBackend from django_filters.rest_framework import DjangoFilterBackend
from djangorestframework_camel_case.util import camelize from djangorestframework_camel_case.util import camelize
from drf_spectacular.utils import ( from drf_spectacular.utils import (
OpenApiExample,
OpenApiParameter, OpenApiParameter,
OpenApiResponse, OpenApiResponse,
OpenApiTypes, OpenApiTypes,
...@@ -143,7 +144,38 @@ class APIDayScheduleViewSet( ...@@ -143,7 +144,38 @@ class APIDayScheduleViewSet(
"Returns a list of the scheduled playout. " "Returns a list of the scheduled playout. "
"The schedule will include virtual timeslots to fill unscheduled gaps if requested." "The schedule will include virtual timeslots to fill unscheduled gaps if requested."
), ),
), examples=[
OpenApiExample(
"Regular timeslot example",
summary="Regular timeslot",
description="Example values for a regular timeslot",
value={
"end": "2024-06-19T20:30:00 +0000",
"id": 2,
"isVirtual": False,
"playlistId": None,
"repetitionOfId": None,
"scheduleId": 9,
"showDefaultPlaylistId": None,
"showId": 3,
"showName": "The Live Show",
"start": "2024-06-17T12:42:47.038Z",
},
),
OpenApiExample(
"Virtual timeslot example",
summary="Virtual timeslot",
description="Example values for a virtual timeslot",
value={
"end": "2024-06-19T20:30:00 +0000",
"isVirtual": True,
"showId": 1,
"showName": "Musicpool",
"start": "2024-06-19T15:00:00 +0000",
},
),
],
)
) )
class APIPlayoutViewSet( class APIPlayoutViewSet(
mixins.ListModelMixin, mixins.ListModelMixin,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment