Skip to content

Commit 072e4bb

Browse files
committed
fix schema import
1 parent 2e80f34 commit 072e4bb

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

server/mergin/sync/public_api_v2.yaml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -588,25 +588,15 @@ components:
588588
type: array
589589
description: List of files in the project
590590
items:
591-
type: object
592-
properties:
593-
path:
594-
type: string
595-
description: File name including path from project root
596-
example: data/layer.gpkg
597-
mtime:
598-
type: string
599-
format: date-time
600-
description: File modification timestamp
601-
example: 2024-11-19T13:50:00Z
602-
size:
603-
type: integer
604-
description: File size in bytes
605-
example: 1234
606-
checksum:
607-
type: string
608-
description: File checksum hash
609-
example: 9adb76bf81a34880209040ffe5ee262a090b62ab
591+
allOf:
592+
- $ref: '#/components/schemas/File'
593+
- type: object
594+
properties:
595+
mtime:
596+
type: string
597+
format: date-time
598+
description: File modification timestamp
599+
example: 2024-11-19T13:50:00Z
610600
File:
611601
type: object
612602
description: Project file metadata

server/mergin/sync/public_api_v2_controller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from marshmallow import ValidationError
1515
from sqlalchemy.exc import IntegrityError
1616

17-
from .schemas_v2 import ProjectSchema
17+
from .schemas_v2 import ProjectSchema as ProjectSchemaV2
1818
from ..app import db
1919
from ..auth import auth_required
2020
from ..auth.models import User
@@ -166,7 +166,7 @@ def remove_project_collaborator(id, user_id):
166166
def get_project(id, files_at_version=None):
167167
"""Get project info. Include list of files at specific version if requested."""
168168
project = require_project_by_uuid(id, ProjectPermissions.Read)
169-
data = ProjectSchema().dump(project)
169+
data = ProjectSchemaV2().dump(project)
170170
if files_at_version:
171171
pv = ProjectVersion.query.filter_by(
172172
project_id=project.id, name=ProjectVersion.from_v_name(files_at_version)

0 commit comments

Comments
 (0)