diff --git a/app/recipe/views.py b/app/recipe/views.py index 65382c3..684f9a8 100644 --- a/app/recipe/views.py +++ b/app/recipe/views.py @@ -1,6 +1,7 @@ """Views for the recipe APIs""" from core.models import Recipe, Tag, Ingredient +from drf_spectacular.utils import extend_schema_view, extend_schema, OpenApiParameter, OpenApiTypes from rest_framework import viewsets, mixins, status from rest_framework.authentication import TokenAuthentication from rest_framework.decorators import action @@ -12,6 +13,23 @@ # Create your views here. + +@extend_schema_view( + list=extend_schema( + parameters=[ + OpenApiParameter( + 'tags', + OpenApiTypes.STR, + description='Comma separated list of IDs to filter', + ), + OpenApiParameter( + 'ingredients', + OpenApiTypes.STR, + description='Comma separated list of IDs to filter', + ) + ] + ) +) class RecipeViewSets(viewsets.ModelViewSet): """View for manage recipe APIs.""" serializer_class = RecipeDetailSerializer