Skip to content

Commit

Permalink
fix: Render bones which are readOnly=True not as required=True (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
phorward authored Jan 19, 2025
1 parent 27ff9a6 commit 50af0e6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/viur/core/bones/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1447,14 +1447,14 @@ def structure(self) -> dict:
ret = {
"descr": self.descr,
"type": self.type,
"required": self.required,
"required": self.required and not self.readOnly,
"params": self.params,
"visible": self.visible,
"readonly": self.readOnly,
"unique": self.unique.method.value if self.unique else False,
"languages": self.languages,
"emptyvalue": self.getEmptyValue(),
"indexed": self.indexed
"indexed": self.indexed,
}

# Provide a defaultvalue, if it's not a function.
Expand All @@ -1470,6 +1470,8 @@ def structure(self) -> dict:
}
else:
ret["multiple"] = self.multiple

# Provide compute information
if self.compute:
ret["compute"] = {
"method": self.compute.interval.method.name
Expand Down

0 comments on commit 50af0e6

Please sign in to comment.