Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 1 addition & 79 deletions server/mergin/sync/public_api_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/Project"
$ref: "#/components/schemas/ProjectDetail"
"204":
$ref: "#/components/responses/NoContent"
"400":
Expand Down Expand Up @@ -845,84 +845,6 @@ components:
type: string
format: date-time
example: 2019-02-26T08:47:58.636074Z
Project:
type: object
required:
- name
properties:
id:
type: string
example: f9ef87ac-1dae-48ab-85cb-062a4784fb83
description: Project UUID
name:
type: string
example: mergin
namespace:
type: string
example: mergin
creator:
nullable: true
type: integer
example: 1
description: Project creator ID
created:
type: string
format: date-time
example: 2018-11-30T08:47:58.636074Z
updated:
type: string
nullable: true
format: date-time
example: 2018-11-30T08:47:58.636074Z
description: Last modified
version:
type: string
nullable: true
example: v2
description: Last project version
disk_usage:
type: integer
example: 25324373
description: Project size in bytes
permissions:
type: object
properties:
delete:
type: boolean
example: false
update:
type: boolean
example: false
upload:
type: boolean
example: true
tags:
type: array
nullable: true
items:
$ref: "#/components/schemas/MerginTag"
uploads:
type: array
nullable: true
items:
type: string
example: 669b838e-a30b-4338-b2b6-3da144742a82
description: UUID for ongoing upload
access:
$ref: "#/components/schemas/Access"
files:
type: array
items:
allOf:
- $ref: "#/components/schemas/FileInfo"
role:
nullable: true
type: string
enum:
- reader
- editor
- writer
- owner
ProjectChangeType:
type: string
enum: [create, update, delete, update_diff]
Expand Down
7 changes: 6 additions & 1 deletion server/mergin/sync/public_api_v2_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,12 @@ def create_project_version(id):
finally:
# remove artifacts
upload.clear()
return ProjectSchema().dump(project), 201

result = ProjectSchemaV2().dump(project)
result["files"] = ProjectFileSchema(
only=("path", "mtime", "size", "checksum"), many=True
).dump(project.files)
return result, 201


@auth_required
Expand Down
Loading