From 2abe07fe1c4bcd001b933e1ee20ddf9082283d70 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 27 Jan 2026 10:56:04 -0600 Subject: [PATCH] Update Series Rules API Swagger Documentation to include required items parameter for TYPE_ARRAY schemas --- CHANGELOG.md | 4 +++- apps/channels/api_views.py | 26 ++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e455048f..975d3120 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [0.18.0] - 2026-01-27 +### Fixed + +- Series Rules API Swagger Documentation: Fixed drf_yasg validation error where TYPE_ARRAY schemas were missing required items parameter, causing module import failure ## [0.18.0] - 2026-01-27 diff --git a/apps/channels/api_views.py b/apps/channels/api_views.py index 40659828..11e7525f 100644 --- a/apps/channels/api_views.py +++ b/apps/channels/api_views.py @@ -2454,7 +2454,18 @@ class SeriesRulesAPIView(APIView): type=openapi.TYPE_OBJECT, properties={ 'success': openapi.Schema(type=openapi.TYPE_BOOLEAN), - 'rules': openapi.Schema(type=openapi.TYPE_ARRAY, description='Updated list of all rules'), + 'rules': openapi.Schema( + type=openapi.TYPE_ARRAY, + items=openapi.Schema( + type=openapi.TYPE_OBJECT, + properties={ + 'tvg_id': openapi.Schema(type=openapi.TYPE_STRING), + 'mode': openapi.Schema(type=openapi.TYPE_STRING), + 'title': openapi.Schema(type=openapi.TYPE_STRING), + }, + ), + description='Updated list of all rules' + ), }, ), ), @@ -2506,7 +2517,18 @@ class DeleteSeriesRuleAPIView(APIView): type=openapi.TYPE_OBJECT, properties={ 'success': openapi.Schema(type=openapi.TYPE_BOOLEAN), - 'rules': openapi.Schema(type=openapi.TYPE_ARRAY, description='Updated list of all rules'), + 'rules': openapi.Schema( + type=openapi.TYPE_ARRAY, + items=openapi.Schema( + type=openapi.TYPE_OBJECT, + properties={ + 'tvg_id': openapi.Schema(type=openapi.TYPE_STRING), + 'mode': openapi.Schema(type=openapi.TYPE_STRING), + 'title': openapi.Schema(type=openapi.TYPE_STRING), + }, + ), + description='Updated list of all rules' + ), }, ), ),