mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
added schema validation on object_type key in mutable dict item
This commit is contained in:
parent
ddd5cbb136
commit
c24ba96bea
1 changed files with 7 additions and 1 deletions
|
|
@ -202,7 +202,7 @@ class DictMutableKeysEntity(EndpointEntity):
|
|||
self.schema_data.get("highlight_content") or False
|
||||
)
|
||||
|
||||
object_type = self.schema_data["object_type"]
|
||||
object_type = self.schema_data.get("object_type") or {}
|
||||
if not isinstance(object_type, dict):
|
||||
# Backwards compatibility
|
||||
object_type = {
|
||||
|
|
@ -226,6 +226,12 @@ class DictMutableKeysEntity(EndpointEntity):
|
|||
def schema_validations(self):
|
||||
super(DictMutableKeysEntity, self).schema_validations()
|
||||
|
||||
if not self.schema_data.get("object_type"):
|
||||
reason = (
|
||||
"Modifiable dictionary must have specified `object_type`."
|
||||
)
|
||||
raise EntitySchemaError(self, reason)
|
||||
|
||||
# TODO Ability to store labels should be defined with different key
|
||||
if self.collapsible_key and not self.file_item:
|
||||
reason = (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue