Skip to content

Commit

Permalink
Fix server schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Marishka17 committed Mar 11, 2025
1 parent c42385b commit 3946e6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 129 deletions.
8 changes: 6 additions & 2 deletions cvat/apps/engine/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,6 @@ def perform_create(self, serializer, **kwargs):
],
deprecated=True,
responses={
'301': OpenApiResponse(description='Redirects to the new API to check status of import process'),
'410': OpenApiResponse(description='API endpoint no longer supports exporting datasets'),
})
@extend_schema(methods=['POST'],
Expand Down Expand Up @@ -592,10 +591,12 @@ def upload_finished(self, request: ExtendedRequest):
return Response(data='Unknown upload was finished',
status=status.HTTP_400_BAD_REQUEST)

@action(detail=True, methods=['GET'], serializer_class=LabeledDataSerializer)
@extend_schema(exclude=True)
@action(detail=True, methods=['GET'])
def annotations(self, request: ExtendedRequest, pk: int):
return get_410_response_for_export_api("/api/projects/<id>/dataset/export?save_images=False")

@extend_schema(exclude=True)
@action(methods=['GET'], detail=True, url_path='backup')
def export_backup(self, request: ExtendedRequest, pk: int):
return get_410_response_for_export_api("/api/projects/<id>/backup/export")
Expand Down Expand Up @@ -1004,6 +1005,7 @@ def import_backup(self, request: ExtendedRequest):
def append_backup_chunk(self, request: ExtendedRequest, file_id: str):
return self.append_tus_chunk(request, file_id)

@extend_schema(exclude=True)
@action(methods=['GET'], detail=True, url_path='backup')
def export_backup(self, request: ExtendedRequest, pk: int):
return get_410_response_for_export_api("/api/tasks/<id>/backup/export")
Expand Down Expand Up @@ -1668,6 +1670,7 @@ def metadata(self, request: ExtendedRequest, pk: int):
serializer = DataMetaReadSerializer(db_data)
return Response(serializer.data)

@extend_schema(exclude=True)
@action(detail=True, methods=['GET'], serializer_class=None, url_path='dataset')
def dataset_export(self, request: ExtendedRequest, pk: int):
return get_410_response_for_export_api("/api/tasks/<id>/dataset/export?save_images=True")
Expand Down Expand Up @@ -2095,6 +2098,7 @@ def append_annotations_chunk(self, request: ExtendedRequest, pk: int, file_id: s
self._object = self.get_object()
return self.append_tus_chunk(request, file_id)

@extend_schema(exclude=True)
@action(detail=True, methods=['GET'], serializer_class=None, url_path='dataset')
def dataset_export(self, request: ExtendedRequest, pk: int):
return get_410_response_for_export_api("/api/jobs/<id>/dataset/export?save_images=True")
Expand Down
127 changes: 0 additions & 127 deletions cvat/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2594,31 +2594,6 @@ paths:
schema:
$ref: '#/components/schemas/DataMetaRead'
description: ''
/api/jobs/{id}/dataset:
get:
operationId: jobs_retrieve_dataset
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this job.
required: true
tags:
- jobs
security:
- sessionAuth: []
csrfAuth: []
tokenAuth: []
- signatureAuth: []
- basicAuth: []
responses:
'200':
content:
application/vnd.cvat+json:
schema:
$ref: '#/components/schemas/JobRead'
description: ''
/api/jobs/{id}/dataset/export:
post:
operationId: jobs_create_dataset_export
Expand Down Expand Up @@ -3736,56 +3711,6 @@ paths:
responses:
'204':
description: The project has been deleted
/api/projects/{id}/annotations:
get:
operationId: projects_retrieve_annotations
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this project.
required: true
tags:
- projects
security:
- sessionAuth: []
csrfAuth: []
tokenAuth: []
- signatureAuth: []
- basicAuth: []
responses:
'200':
content:
application/vnd.cvat+json:
schema:
$ref: '#/components/schemas/ProjectRead'
description: ''
/api/projects/{id}/backup:
get:
operationId: projects_retrieve_backup
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this project.
required: true
tags:
- projects
security:
- sessionAuth: []
csrfAuth: []
tokenAuth: []
- signatureAuth: []
- basicAuth: []
responses:
'200':
content:
application/vnd.cvat+json:
schema:
$ref: '#/components/schemas/ProjectRead'
description: ''
/api/projects/{id}/backup/export:
post:
operationId: projects_create_backup_export
Expand Down Expand Up @@ -3920,8 +3845,6 @@ paths:
- basicAuth: []
deprecated: true
responses:
'301':
description: Redirects to the new API to check status of import process
'410':
description: API endpoint no longer supports exporting datasets
post:
Expand Down Expand Up @@ -5540,31 +5463,6 @@ paths:
responses:
'204':
description: The annotation has been deleted
/api/tasks/{id}/backup:
get:
operationId: tasks_retrieve_backup
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this task.
required: true
tags:
- tasks
security:
- sessionAuth: []
csrfAuth: []
tokenAuth: []
- signatureAuth: []
- basicAuth: []
responses:
'200':
content:
application/vnd.cvat+json:
schema:
$ref: '#/components/schemas/TaskRead'
description: ''
/api/tasks/{id}/backup/export:
post:
operationId: tasks_create_backup_export
Expand Down Expand Up @@ -5831,31 +5729,6 @@ paths:
schema:
$ref: '#/components/schemas/DataMetaRead'
description: ''
/api/tasks/{id}/dataset:
get:
operationId: tasks_retrieve_dataset
parameters:
- in: path
name: id
schema:
type: integer
description: A unique integer value identifying this task.
required: true
tags:
- tasks
security:
- sessionAuth: []
csrfAuth: []
tokenAuth: []
- signatureAuth: []
- basicAuth: []
responses:
'200':
content:
application/vnd.cvat+json:
schema:
$ref: '#/components/schemas/TaskRead'
description: ''
/api/tasks/{id}/dataset/export:
post:
operationId: tasks_create_dataset_export
Expand Down

0 comments on commit 3946e6f

Please sign in to comment.