Skip to content

Commit

Permalink
fix: RND-56: Fix some errors with api schema (#5877)
Browse files Browse the repository at this point in the history
Some of the parameters provided in swagger decorators are incorrect and
break openapi3 validation checks.

---------

Co-authored-by: nik <[email protected]>
  • Loading branch information
niklub and nik authored May 13, 2024
1 parent ec26634 commit f944e5f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 31 deletions.
17 changes: 0 additions & 17 deletions label_studio/io_storages/all_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from core.permissions import all_permissions
from django.conf import settings
from django.utils.decorators import method_decorator
from drf_yasg import openapi
from drf_yasg.utils import swagger_auto_schema
from rest_framework import generics
from rest_framework.parsers import FormParser, JSONParser, MultiPartParser
Expand Down Expand Up @@ -79,14 +78,6 @@ def get(self, request, **kwargs):
tags=['Storage'],
operation_summary='List all import storages from the project',
operation_description='Retrieve a list of the import storages of all types with their IDs.',
manual_parameters=[
openapi.Parameter(
name='project',
type=openapi.TYPE_INTEGER,
in_=openapi.IN_PATH,
description='A unique integer value identifying your project.',
),
],
responses={200: 'List of ImportStorageSerializer'},
),
)
Expand Down Expand Up @@ -119,14 +110,6 @@ def list(self, request, *args, **kwargs):
tags=['Storage'],
operation_summary='List all export storages from the project',
operation_description='Retrieve a list of the export storages of all types with their IDs.',
manual_parameters=[
openapi.Parameter(
name='project',
type=openapi.TYPE_INTEGER,
in_=openapi.IN_PATH,
description='A unique integer value identifying your project.',
),
],
responses={200: 'List of ExportStorageSerializer'},
),
)
Expand Down
14 changes: 0 additions & 14 deletions label_studio/organizations/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,6 @@ def get_page_size(self, request):
tags=['Organizations'],
operation_summary='Get organization members list',
operation_description='Retrieve a list of the organization members and their IDs.',
manual_parameters=[
openapi.Parameter(
name='id',
type=openapi.TYPE_INTEGER,
in_=openapi.IN_PATH,
description='A unique integer value identifying this organization.',
),
],
),
)
class OrganizationMemberListAPI(generics.ListAPIView):
Expand Down Expand Up @@ -142,12 +134,6 @@ def get_queryset(self):
operation_summary='Soft delete an organization member',
operation_description='Soft delete a member from the organization.',
manual_parameters=[
openapi.Parameter(
name='pk',
type=openapi.TYPE_INTEGER,
in_=openapi.IN_PATH,
description='A unique integer value identifying this organization.',
),
openapi.Parameter(
name='user_pk',
type=openapi.TYPE_INTEGER,
Expand Down
1 change: 1 addition & 0 deletions label_studio/projects/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ def create(self, request, *args, **kwargs):
name='post',
decorator=swagger_auto_schema(
tags=['Projects'],
operation_id='api_projects_validate_label_config',
operation_summary='Validate project label config',
operation_description="""
Determine whether the label configuration for a specific project is valid.
Expand Down

0 comments on commit f944e5f

Please sign in to comment.