Skip to content
Snippets Groups Projects
Verified Commit 3a18517d authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

fix: add examples to basic & playout views

parent 3541fc61
No related branches found
No related tags found
1 merge request!52new program endpoint
...@@ -107,10 +107,34 @@ class AbstractAPIProgramViewSet( ...@@ -107,10 +107,34 @@ class AbstractAPIProgramViewSet(
@extend_schema_view( @extend_schema_view(
list=extend_schema( list=extend_schema(
examples=[
OpenApiExample(
"Example entry",
value={
"end": "2024-07-15T15:30:00-04:00",
"id": "2024-07-15T19:07:38.604349+00:00...2024-07-15T19:30:00+00:00",
"playlistId": None,
"showId": 1,
"start": "2024-07-15T15:07:38.604349-04:00",
"timeslotId": None,
},
),
OpenApiExample(
"Example virtual entry",
value={
"end": "2024-07-15T18:00:00-04:00",
"id": "2024-07-15T19:30:00+00:00...2024-07-15T22:00:00+00:00",
"playlistId": None,
"showId": 3,
"start": "2024-07-15T15:30:00-04:00",
"timeslotId": 141,
},
),
],
summary=( summary=(
"List program for a specific date range. " "List program for a specific date range. "
"Only returns the most basic data for clients that fetch other data themselves." "Only returns the most basic data for clients that fetch other data themselves."
) ),
), ),
) )
class APIProgramBasicViewSet(AbstractAPIProgramViewSet): class APIProgramBasicViewSet(AbstractAPIProgramViewSet):
...@@ -119,11 +143,53 @@ class APIProgramBasicViewSet(AbstractAPIProgramViewSet): ...@@ -119,11 +143,53 @@ class APIProgramBasicViewSet(AbstractAPIProgramViewSet):
@extend_schema_view( @extend_schema_view(
list=extend_schema( list=extend_schema(
examples=[
OpenApiExample(
"Example entry",
value={
"end": "2024-07-16T12:30:00-04:00",
"episode": {"id": 11, "title": ""},
"id": "2024-07-16T14:00:00+00:00...2024-07-16T16:30:00+00:00",
"playlistId": None,
"schedule": {"defaultPlaylistId": None, "id": 1},
"show": {"defaultPlaylistId": None, "id": 2, "name": "EINS"},
"showId": 2,
"start": "2024-07-16T10:00:00-04:00",
"timeslot": {
"end": "2024-07-16T12:30:00-04:00",
"id": 11,
"memo": "",
"noteId": 11,
"playlistId": None,
"repetitionOfId": None,
"scheduleId": 1,
"showId": 2,
"start": "2024-07-16T10:00:00-04:00",
},
"timeslotId": 11,
},
),
OpenApiExample(
"Example virtual entry",
value={
"end": "2024-07-16T15:23:34.084852-04:00",
"episode": None,
"id": "2024-07-16T16:30:00+00:00...2024-07-16T19:23:34.084852+00:00",
"playlistId": None,
"schedule": None,
"show": {"defaultPlaylistId": None, "id": 1, "name": "Musikpool"},
"showId": 1,
"start": "2024-07-16T12:30:00-04:00",
"timeslot": None,
"timeslotId": None,
},
),
],
summary=( summary=(
"List program for a specific date range. " "List program for a specific date range. "
"Returns an extended program dataset for use in the AURA engine. " "Returns an extended program dataset for use in the AURA engine. "
"Not recommended for other tools." "Not recommended for other tools."
) ),
), ),
) )
class APIProgramPlayoutViewSet(AbstractAPIProgramViewSet): class APIProgramPlayoutViewSet(AbstractAPIProgramViewSet):
......
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