Skip to content

Commit 7b8670b

Browse files
author
Johannes Lichtenberger
committed
feat: add include_data parameter to diff method
Add include_data parameter (default True) to the diff method to control whether jsonFragment data is included in the diff response. This uses the include-data query parameter of the Sirix REST API. Default is True for backward compatibility with existing behavior.
1 parent 93f220a commit 7b8670b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pysirix/resource.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ def diff(
182182
second_revision: Revision,
183183
node_id: int = None,
184184
max_depth: int = None,
185+
include_data: bool = True,
185186
):
186187
params = {}
187188
if isinstance(first_revision, datetime):
@@ -196,6 +197,8 @@ def diff(
196197
params["startNodeKey"] = node_id
197198
if max_depth is not None:
198199
params["maxDepth"] = max_depth
200+
if include_data:
201+
params["include-data"] = "true"
199202
return self._client.diff(self.db_name, self.resource_name, params)
200203

201204
def get_etag(self, node_id: int) -> Union[str, Awaitable[str]]:

0 commit comments

Comments
 (0)