From d1e3596e599658038680d838b01d2f5d16ae6933 Mon Sep 17 00:00:00 2001 From: Valentin Deniaud Date: Thu, 8 Jul 2021 12:28:02 +0200 Subject: [PATCH] cmis: include descriptions in file upload schema (#54661) --- passerelle/apps/cmis/models.py | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/passerelle/apps/cmis/models.py b/passerelle/apps/cmis/models.py index 98c6f665..c94fee0c 100644 --- a/passerelle/apps/cmis/models.py +++ b/passerelle/apps/cmis/models.py @@ -45,29 +45,48 @@ FILE_NAME_PATTERN = r'[\w%s\.]+$' % re.escape(SPECIAL_CHARS) UPLOAD_SCHEMA = { 'type': 'object', + 'title': _('CMIS file upload'), 'properties': { 'file': { + 'title': _('File object'), 'type': 'object', 'properties': { 'filename': { 'type': 'string', + 'description': _('Filename (numbers, letters and special caracters "%s" are allowed)') + % SPECIAL_CHARS, 'pattern': FILE_NAME_PATTERN, }, - 'content': {'type': 'string'}, - 'content_type': {'type': 'string'}, + 'content': { + 'type': 'string', + 'description': _('Content'), + }, + 'content_type': { + 'type': 'string', + 'description': _('Content type'), + }, }, 'required': ['content'], }, 'filename': { 'type': 'string', + 'description': _('Filename (takes precendence over filename in "file" object)'), 'pattern': FILE_NAME_PATTERN, }, 'path': { 'type': 'string', + 'description': _('File path (with leading but not trailing slash)'), 'pattern': FILE_PATH_PATTERN, }, - 'object_type': {'type': 'string'}, - 'properties': {'type': 'object', 'additionalProperties': {'type': 'string'}}, + 'object_type': { + 'type': 'string', + 'description': _('CMIS object type'), + }, + 'properties': { + 'type': 'object', + 'title': _('CMIS properties'), + 'additionalProperties': {'type': 'string'}, + }, }, 'required': ['file', 'path'], 'unflatten': True, -- 2.20.1