From 2d6033aaff302fa487fe7166bb93c49a353a86c9 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 7 Jan 2021 16:30:47 +0100 Subject: [PATCH] added workfile schema --- pype/lib/avalon_context.py | 1 + schema/workfile-1.0.json | 52 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 schema/workfile-1.0.json diff --git a/pype/lib/avalon_context.py b/pype/lib/avalon_context.py index 46a9e9bf2c..7813794752 100644 --- a/pype/lib/avalon_context.py +++ b/pype/lib/avalon_context.py @@ -434,6 +434,7 @@ def create_workfile_doc(asset_doc, task_name, filename, workdir, dbcon=None): template_workdir.rootless.replace("\\", "/") ) + doc_data["schema"] = "pype:workfile-1.0" doc_data["files"] = ["/".join([rootles_workdir, filename])] doc_data["data"] = {} diff --git a/schema/workfile-1.0.json b/schema/workfile-1.0.json new file mode 100644 index 0000000000..15bfdc6ff7 --- /dev/null +++ b/schema/workfile-1.0.json @@ -0,0 +1,52 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + + "title": "pype:workfile-1.0", + "description": "Workfile additional information.", + + "type": "object", + + "additionalProperties": true, + + "required": [ + "schema", + "type", + "filename", + "task_name", + "parent" + ], + + "properties": { + "schema": { + "description": "Schema identifier for payload", + "type": "string", + "enum": ["pype:workfile-1.0"], + "example": "pype:workfile-1.0" + }, + "type": { + "description": "The type of document", + "type": "string", + "enum": ["workfile"], + "example": "workfile" + }, + "parent": { + "description": "Unique identifier to parent document", + "example": "592c33475f8c1b064c4d1696" + }, + "filename": { + "description": "Workfile's filename", + "type": "string", + "example": "kuba_each_case_Alpaca_01_animation_v001.ma" + }, + "task_name": { + "description": "Task name", + "type": "string", + "example": "animation" + }, + "data": { + "description": "Document metadata", + "type": "object", + "example": {"key": "value"} + } + } +}