From 10613cb20a98751130c2c958281c421245527094 Mon Sep 17 00:00:00 2001 From: jo Date: Tue, 19 Jul 2022 19:21:58 +0200 Subject: [PATCH] chore(api): fix schema enum names --- api/libretime_api/settings/_internal.py | 6 ++++++ api/schema.yml | 26 ++++++++++--------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/api/libretime_api/settings/_internal.py b/api/libretime_api/settings/_internal.py index c2c2f9fca..ab9334292 100644 --- a/api/libretime_api/settings/_internal.py +++ b/api/libretime_api/settings/_internal.py @@ -166,8 +166,14 @@ AUTH_USER_MODEL = "core.User" # Spectacular # https://drf-spectacular.readthedocs.io/en/latest/settings.html +SPECTACULAR_ENUM_NAME_OVERRIDES = { + "SmartBlockKindEnum": "libretime_api.schedule.models.SmartBlock.Kind", + "PlaylistContentKindEnum": "libretime_api.schedule.models.PlaylistContent.Kind", +} + SPECTACULAR_SETTINGS = { "TITLE": "LibreTime API", "DESCRIPTION": "Radio Broadcast & Automation Platform", "VERSION": API_VERSION, + "ENUM_NAME_OVERRIDES": SPECTACULAR_ENUM_NAME_OVERRIDES, } diff --git a/api/schema.yml b/api/schema.yml index d2dd093db..c317668eb 100644 --- a/api/schema.yml +++ b/api/schema.yml @@ -5415,7 +5415,7 @@ components: readOnly: true import_status: allOf: - - $ref: "#/components/schemas/ImportStatusEnum" + - $ref: "#/components/schemas/PlaylistContentKindEnum" minimum: -2147483648 maximum: 2147483647 filepath: @@ -5671,12 +5671,6 @@ components: - mime - name - size - ImportStatusEnum: - enum: - - 0 - - 1 - - 2 - type: integer ImportedPodcast: type: object properties: @@ -5700,12 +5694,6 @@ components: - item_url - override_album - podcast - Kind1d2Enum: - enum: - - 0 - - 1 - - 2 - type: integer Library: type: object properties: @@ -5838,7 +5826,7 @@ components: readOnly: true import_status: allOf: - - $ref: "#/components/schemas/ImportStatusEnum" + - $ref: "#/components/schemas/PlaylistContentKindEnum" minimum: -2147483648 maximum: 2147483647 filepath: @@ -6219,7 +6207,7 @@ components: readOnly: true kind: allOf: - - $ref: "#/components/schemas/Kind1d2Enum" + - $ref: "#/components/schemas/PlaylistContentKindEnum" minimum: -32768 maximum: 32767 position: @@ -7043,7 +7031,7 @@ components: readOnly: true kind: allOf: - - $ref: "#/components/schemas/Kind1d2Enum" + - $ref: "#/components/schemas/PlaylistContentKindEnum" minimum: -32768 maximum: 32767 position: @@ -7091,6 +7079,12 @@ components: - item_url - kind - offset + PlaylistContentKindEnum: + enum: + - 0 + - 1 + - 2 + type: integer PlayoutHistory: type: object properties: