Skip to content

Commit

Permalink
Fix swagger specification (#6825)
Browse files Browse the repository at this point in the history
Resolved #6823
  • Loading branch information
Marishka17 authored Sep 11, 2023
1 parent c87d05a commit 32647e0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- TDB

### Fixed
- Invalid input validation in for `cloud_storage_id` (<https://github.com/opencv/cvat/pull/6825>)
- Incorrect task progress report for 3rdparty users (<https://github.com/opencv/cvat/pull/6834>)

### Security
Expand Down
28 changes: 14 additions & 14 deletions cvat/apps/engine/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def perform_create(self, serializer, **kwargs):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list()),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
OpenApiParameter('use_default_location', description='Use the location that was configured in project to import dataset',
location=OpenApiParameter.QUERY, type=OpenApiTypes.BOOL, required=False,
default=True),
Expand Down Expand Up @@ -331,7 +331,7 @@ def perform_create(self, serializer, **kwargs):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list()),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
OpenApiParameter('use_default_location', description='Use the location that was configured in the project to import annotations',
location=OpenApiParameter.QUERY, type=OpenApiTypes.BOOL, required=False,
default=True),
Expand Down Expand Up @@ -467,7 +467,7 @@ def upload_finished(self, request):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list()),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
OpenApiParameter('use_default_location', description='Use the location that was configured in project to export annotation',
location=OpenApiParameter.QUERY, type=OpenApiTypes.BOOL, required=False,
default=True),
Expand Down Expand Up @@ -506,7 +506,7 @@ def annotations(self, request, pk):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list()),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
OpenApiParameter('use_default_location', description='Use the location that was configured in project to export backup',
location=OpenApiParameter.QUERY, type=OpenApiTypes.BOOL, required=False,
default=True),
Expand Down Expand Up @@ -539,7 +539,7 @@ def export_backup(self, request, pk=None):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list(), default=Location.LOCAL),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
OpenApiParameter('filename', description='Backup file name',
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False),
OpenApiParameter('rq_id', description='rq id',
Expand Down Expand Up @@ -825,7 +825,7 @@ def get_queryset(self):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list(), default=Location.LOCAL),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
OpenApiParameter('filename', description='Backup file name',
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False),
OpenApiParameter('rq_id', description='rq id',
Expand Down Expand Up @@ -862,7 +862,7 @@ def append_backup_chunk(self, request, file_id):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list()),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
OpenApiParameter('use_default_location', description='Use the location that was configured in the task to export backup',
location=OpenApiParameter.QUERY, type=OpenApiTypes.BOOL, required=False,
default=True),
Expand Down Expand Up @@ -1213,7 +1213,7 @@ def append_data_chunk(self, request, pk, file_id):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list()),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
OpenApiParameter('use_default_location', description='Use the location that was configured in the task to export annotation',
location=OpenApiParameter.QUERY, type=OpenApiTypes.BOOL, required=False,
default=True),
Expand Down Expand Up @@ -1267,7 +1267,7 @@ def append_data_chunk(self, request, pk, file_id):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list()),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
OpenApiParameter('use_default_location', description='Use the location that was configured in task to import annotations',
location=OpenApiParameter.QUERY, type=OpenApiTypes.BOOL, required=False,
default=True),
Expand Down Expand Up @@ -1467,7 +1467,7 @@ def metadata(self, request, pk):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list()),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
],
responses={
'200': OpenApiResponse(OpenApiTypes.BINARY, description='Download of file started'),
Expand Down Expand Up @@ -1652,7 +1652,7 @@ def upload_finished(self, request):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list()),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
OpenApiParameter('use_default_location', description='Use the location that was configured in the task to export annotation',
location=OpenApiParameter.QUERY, type=OpenApiTypes.BOOL, required=False,
default=True),
Expand Down Expand Up @@ -1681,7 +1681,7 @@ def upload_finished(self, request):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list()),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
OpenApiParameter('use_default_location', description='Use the location that was configured in the task to import annotation',
location=OpenApiParameter.QUERY, type=OpenApiTypes.BOOL, required=False,
default=True),
Expand Down Expand Up @@ -1711,7 +1711,7 @@ def upload_finished(self, request):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list()),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
OpenApiParameter('use_default_location', description='Use the location that was configured in the task to import annotation',
location=OpenApiParameter.QUERY, type=OpenApiTypes.BOOL, required=False,
default=True),
Expand Down Expand Up @@ -1832,7 +1832,7 @@ def append_annotations_chunk(self, request, pk, file_id):
location=OpenApiParameter.QUERY, type=OpenApiTypes.STR, required=False,
enum=Location.list()),
OpenApiParameter('cloud_storage_id', description='Storage id',
location=OpenApiParameter.QUERY, type=OpenApiTypes.NUMBER, required=False),
location=OpenApiParameter.QUERY, type=OpenApiTypes.INT, required=False),
],
responses={
'200': OpenApiResponse(OpenApiTypes.BINARY, description='Download of file started'),
Expand Down
28 changes: 14 additions & 14 deletions cvat/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1944,7 +1944,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down Expand Up @@ -2013,7 +2013,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down Expand Up @@ -2090,7 +2090,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down Expand Up @@ -2335,7 +2335,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down Expand Up @@ -3347,7 +3347,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down Expand Up @@ -3422,7 +3422,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down Expand Up @@ -3489,7 +3489,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down Expand Up @@ -3564,7 +3564,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down Expand Up @@ -3676,7 +3676,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down Expand Up @@ -4631,7 +4631,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down Expand Up @@ -4702,7 +4702,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down Expand Up @@ -4896,7 +4896,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down Expand Up @@ -5155,7 +5155,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down Expand Up @@ -5291,7 +5291,7 @@ paths:
- in: query
name: cloud_storage_id
schema:
type: number
type: integer
description: Storage id
- in: query
name: filename
Expand Down

0 comments on commit 32647e0

Please sign in to comment.