kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
Fix client API generation
rodzic
0c9b753ae0
commit
c19b3d3545
|
@ -5,7 +5,7 @@ from rest_framework import exceptions
|
||||||
from rest_framework import response
|
from rest_framework import response
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
from drf_spectacular.utils import extend_schema
|
from drf_spectacular.utils import extend_schema, OpenApiParameter
|
||||||
|
|
||||||
from . import filters
|
from . import filters
|
||||||
from . import models
|
from . import models
|
||||||
|
@ -93,7 +93,9 @@ def mutations_route(types):
|
||||||
methods=["post"], responses=serializers.APIMutationSerializer()
|
methods=["post"], responses=serializers.APIMutationSerializer()
|
||||||
)(
|
)(
|
||||||
extend_schema(
|
extend_schema(
|
||||||
methods=["get"], responses=serializers.APIMutationSerializer(many=True)
|
methods=["get"],
|
||||||
|
responses=serializers.APIMutationSerializer(many=True),
|
||||||
|
parameters=[OpenApiParameter("id", location="query", exclude=True)],
|
||||||
)(
|
)(
|
||||||
decorators.action(
|
decorators.action(
|
||||||
methods=["get", "post"], detail=True, required_scope="edits"
|
methods=["get", "post"], detail=True, required_scope="edits"
|
||||||
|
|
|
@ -5,7 +5,7 @@ from rest_framework import permissions
|
||||||
from rest_framework import response
|
from rest_framework import response
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
from drf_spectacular.utils import extend_schema
|
from drf_spectacular.utils import extend_schema, OpenApiParameter
|
||||||
|
|
||||||
from funkwhale_api.common import utils as common_utils
|
from funkwhale_api.common import utils as common_utils
|
||||||
|
|
||||||
|
@ -46,7 +46,9 @@ def fetches_route():
|
||||||
|
|
||||||
return extend_schema(methods=["post"], responses=api_serializers.FetchSerializer())(
|
return extend_schema(methods=["post"], responses=api_serializers.FetchSerializer())(
|
||||||
extend_schema(
|
extend_schema(
|
||||||
methods=["get"], responses=api_serializers.FetchSerializer(many=True)
|
methods=["get"],
|
||||||
|
responses=api_serializers.FetchSerializer(many=True),
|
||||||
|
parameters=[OpenApiParameter("id", location="query", exclude=True)],
|
||||||
)(
|
)(
|
||||||
decorators.action(
|
decorators.action(
|
||||||
methods=["get", "post"],
|
methods=["get", "post"],
|
||||||
|
|
|
@ -16,7 +16,7 @@ from rest_framework import views, viewsets
|
||||||
from rest_framework.decorators import action
|
from rest_framework.decorators import action
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
|
|
||||||
from drf_spectacular.utils import extend_schema
|
from drf_spectacular.utils import extend_schema, OpenApiParameter
|
||||||
|
|
||||||
import requests.exceptions
|
import requests.exceptions
|
||||||
|
|
||||||
|
@ -69,7 +69,8 @@ def get_libraries(filter_uploads):
|
||||||
return Response(serializer.data)
|
return Response(serializer.data)
|
||||||
|
|
||||||
return extend_schema(
|
return extend_schema(
|
||||||
responses=federation_api_serializers.LibrarySerializer(many=True)
|
responses=federation_api_serializers.LibrarySerializer(many=True),
|
||||||
|
parameters=[OpenApiParameter("id", location="query", exclude=True)],
|
||||||
)(action(methods=["get"], detail=True)(libraries))
|
)(action(methods=["get"], detail=True)(libraries))
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue