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

refactor: add custom OpenAPI examples to playout endpoint

parent 83b6d2b8
No related branches found
No related tags found
1 merge request!50Add custom examples to playout endpoint
Pipeline #8254 passed
......@@ -25,6 +25,7 @@ from textwrap import dedent
from django_filters.rest_framework import DjangoFilterBackend
from drf_spectacular.utils import (
OpenApiExample,
OpenApiParameter,
OpenApiResponse,
OpenApiTypes,
......@@ -191,7 +192,38 @@ class APIDayScheduleViewSet(
"Returns a list of the scheduled playout. "
"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(
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