From dee702b7104f9bee349d59c58b44835a84689a41 Mon Sep 17 00:00:00 2001
From: Ernesto Rico Schmidt <ernesto@helsinki.at>
Date: Wed, 3 Jul 2024 12:03:37 -0400
Subject: [PATCH] feat: add example Radio Settings annotation

---
 program/views.py | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/program/views.py b/program/views.py
index 6370cc77..df98edd3 100644
--- a/program/views.py
+++ b/program/views.py
@@ -937,7 +937,38 @@ class APILicenseViewSet(viewsets.ModelViewSet):
 
 
 @extend_schema_view(
-    list=extend_schema(summary="List all settings."),
+    list=extend_schema(
+        # TODO: move this into the serializers
+        examples=[
+            OpenApiExample(
+                "Example Radio Settings",
+                value={
+                    "id": 1,
+                    "cba": {"domains": ["cba.media"]},
+                    "imageRequirements": {
+                        "host.image": {"frame": {"aspectRatio": [1, 1], "shape": "round"}},
+                        "note.image": {"frame": {"aspectRatio": [16, 9], "shape": "round"}},
+                        "show.image": {"frame": {"aspectRatio": [16, 9], "shape": "round"}},
+                        "show.logo": {"frame": {"aspectRatio": [1, 1], "shape": "round"}},
+                    },
+                    "playout": {
+                        "lineInChannels": {"0": "live", "1": "preprod"},
+                        "pools": {"fallback": "Station Fallback Pool"},
+                    },
+                    "program": {
+                        "micro": {"showId": None},
+                        "fallback": {"showId": None, "defaultPool": "fallback"},
+                    },
+                    "station": {
+                        "name": "Radio AURA",
+                        "logo": None,
+                        "website": "https://aura.radio",
+                    },
+                },
+            )
+        ],
+        summary="List all settings.",
+    ),
 )
 class APIRadioSettingsViewSet(mixins.ListModelMixin, viewsets.GenericViewSet):
     queryset = RadioSettings.objects.all()
-- 
GitLab