From ff1a6148617a48737783c9c23b73d93426233711 Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Sat, 8 Oct 2022 17:55:09 +0000 Subject: [PATCH] Resolve "Refactor mutations endpoints" --- api/config/schema.py | 3 --- api/funkwhale_api/common/filters.py | 3 +++ changes/changelog.d/mutations.enhancement | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changes/changelog.d/mutations.enhancement diff --git a/api/config/schema.py b/api/config/schema.py index caa1296d1..b1e5ab632 100644 --- a/api/config/schema.py +++ b/api/config/schema.py @@ -53,9 +53,6 @@ def custom_preprocessing_hook(endpoints): if path.startswith("/api/v1/users/users"): continue - if path.startswith("/api/v1/mutations"): - continue - if path.startswith(f"/api/{api_type}"): filtered.append((path, path_regex, method, callback)) diff --git a/api/funkwhale_api/common/filters.py b/api/funkwhale_api/common/filters.py index 6bfa12f04..600ca6a01 100644 --- a/api/funkwhale_api/common/filters.py +++ b/api/funkwhale_api/common/filters.py @@ -1,6 +1,8 @@ from django import forms from django.db.models import Q +from drf_spectacular.utils import extend_schema_field + from django_filters import widgets from django_filters import rest_framework as filters @@ -52,6 +54,7 @@ class CoerceChoiceField(forms.ChoiceField): raise forms.ValidationError("Invalid value {}".format(value)) +@extend_schema_field(bool) class NullBooleanFilter(filters.ChoiceFilter): field_class = CoerceChoiceField diff --git a/changes/changelog.d/mutations.enhancement b/changes/changelog.d/mutations.enhancement new file mode 100644 index 000000000..711281961 --- /dev/null +++ b/changes/changelog.d/mutations.enhancement @@ -0,0 +1 @@ +Make mutations endpoint appear in openapi specs