Skip to content

Commit a9954a7

Browse files
committed
change to use enable_derived_annotations
1 parent 8b93cac commit a9954a7

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

docs/tutorials/python/json_schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Note: If you update your schema, you can re-register it with the organization an
5050
## 4. Bind the JSON Schema to the Folder
5151
After creating the organization, you can now bind your json schema to a test folder. When you bind a JSON Schema to a container entity such as a project or folder, then all items inside of the project or folder will inherit the schema binding, unless the item has a schema bound to itself.
5252

53-
When you bind the schema, you may also include the boolean property `enable_derived_annos` to have Synapse automatically calculate derived annotations based on the schema:
53+
When you bind the schema, you may also include the boolean property `enable_derived_annotations` to have Synapse automatically calculate derived annotations based on the schema:
5454

5555
```python
5656
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=93-100}

docs/tutorials/python/tutorial_scripts/json_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
# 4. Bind the JSON schema to the folder
9393
schema_uri = ORG_NAME + "-" + SCHEMA_NAME + "-" + VERSION
9494
bound_schema = test_folder.bind_schema(
95-
json_schema_uri=schema_uri, enable_derived_annos=True
95+
json_schema_uri=schema_uri, enable_derived_annotations=True
9696
)
9797
json_schema_version_info = bound_schema.json_schema_version_info
9898
print("JSON schema was bound successfully. Please see details below:")

synapseclient/api/json_schema_services.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def bind_json_schema_to_entity(
2020
synapse_id: str,
2121
json_schema_uri: str,
2222
*,
23-
enable_derived_annos: bool = False,
23+
enable_derived_annotations: bool = False,
2424
synapse_client: Optional["Synapse"] = None,
2525
) -> Union[Dict[str, Any], str]:
2626
"""
@@ -31,7 +31,7 @@ async def bind_json_schema_to_entity(
3131
Arguments:
3232
synapse_id: Synapse Entity or Synapse Id
3333
json_schema_uri: JSON schema URI
34-
enable_derived_annos: If True, derived annotations will be enabled for this entity
34+
enable_derived_annotations: If True, derived annotations will be enabled for this entity
3535
synapse_client: If not passed in and caching was not disabled by
3636
`Synapse.allow_client_caching(False)` this will use the last created
3737
instance from the Synapse class constructor
@@ -44,7 +44,7 @@ async def bind_json_schema_to_entity(
4444
request_body = {
4545
"entityId": synapse_id,
4646
"schema$id": json_schema_uri,
47-
"enableDerivedAnnotations": enable_derived_annos,
47+
"enableDerivedAnnotations": enable_derived_annotations,
4848
}
4949
return await client.rest_put_async(
5050
uri=f"/entity/{synapse_id}/schema/binding", body=json.dumps(request_body)

synapseclient/models/mixins/json_schema.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,15 @@ async def bind_schema_async(
196196
self,
197197
json_schema_uri: str,
198198
*,
199-
enable_derived_annos: bool = False,
199+
enable_derived_annotations: bool = False,
200200
synapse_client: Optional["Synapse"] = None,
201201
) -> JSONSchemaBinding:
202202
"""
203203
Bind a JSON schema to the entity.
204204
205205
Arguments:
206206
json_schema_uri: The URI of the JSON schema to bind to the entity.
207-
enable_derived_annos: If true, enable derived annotations. Defaults to False.
207+
enable_derived_annotations: If true, enable derived annotations. Defaults to False.
208208
synapse_client: The Synapse client instance. If not provided,
209209
the last created instance from the Synapse class constructor will be used.
210210
@@ -264,7 +264,7 @@ async def bind_schema_async(
264264
async def bind_json_schema():
265265
bound_schema = await test_folder.bind_schema_async(
266266
json_schema_uri=SCHEMA_URI,
267-
enable_derived_annos=True
267+
enable_derived_annotations=True
268268
)
269269
return bound_schema
270270
asyncio.run(bind_json_schema())
@@ -278,7 +278,7 @@ async def bind_json_schema():
278278
async def bind_schema_to_file():
279279
bound_schema_file = await example_file.bind_schema_async(
280280
json_schema_uri=SCHEMA_URI,
281-
enable_derived_annos=True
281+
enable_derived_annotations=True
282282
)
283283
return bound_schema_file
284284
asyncio.run(bind_schema_to_file())
@@ -287,7 +287,7 @@ async def bind_schema_to_file():
287287
response = await bind_json_schema_to_entity(
288288
synapse_id=self.id,
289289
json_schema_uri=json_schema_uri,
290-
enable_derived_annos=enable_derived_annos,
290+
enable_derived_annotations=enable_derived_annotations,
291291
synapse_client=synapse_client,
292292
)
293293
json_schema_version = response.get("jsonSchemaVersionInfo", {})
@@ -377,7 +377,7 @@ async def get_schema_async(
377377
async def bind_json_schema():
378378
bound_schema = await test_folder.bind_schema_async(
379379
json_schema_uri=SCHEMA_URI,
380-
enable_derived_annos=True
380+
enable_derived_annotations=True
381381
)
382382
return bound_schema
383383
asyncio.run(bind_json_schema())
@@ -391,7 +391,7 @@ async def bind_json_schema():
391391
async def bind_schema_to_file():
392392
bound_schema_file = await example_file.bind_schema_async(
393393
json_schema_uri=SCHEMA_URI,
394-
enable_derived_annos=True
394+
enable_derived_annotations=True
395395
)
396396
return bound_schema_file
397397
asyncio.run(bind_schema_to_file())
@@ -500,7 +500,7 @@ async def unbind_schema_async(
500500
async def bind_json_schema():
501501
bound_schema = await test_folder.bind_schema_async(
502502
json_schema_uri=SCHEMA_URI,
503-
enable_derived_annos=True
503+
enable_derived_annotations=True
504504
)
505505
return bound_schema
506506
asyncio.run(bind_json_schema())
@@ -514,7 +514,7 @@ async def bind_json_schema():
514514
async def bind_schema_to_file():
515515
bound_schema_file = await example_file.bind_schema_async(
516516
json_schema_uri=SCHEMA_URI,
517-
enable_derived_annos=True
517+
enable_derived_annotations=True
518518
)
519519
return bound_schema_file
520520
asyncio.run(bind_schema_to_file())
@@ -602,7 +602,7 @@ async def validate_schema_async(
602602
async def bind_json_schema():
603603
bound_schema = await test_folder.bind_schema_async(
604604
json_schema_uri=SCHEMA_URI,
605-
enable_derived_annos=True
605+
enable_derived_annotations=True
606606
)
607607
return bound_schema
608608
asyncio.run(bind_json_schema())
@@ -616,7 +616,7 @@ async def bind_json_schema():
616616
async def bind_schema_to_file():
617617
bound_schema_file = await example_file.bind_schema_async(
618618
json_schema_uri=SCHEMA_URI,
619-
enable_derived_annos=True
619+
enable_derived_annotations=True
620620
)
621621
return bound_schema_file
622622
asyncio.run(bind_schema_to_file())
@@ -768,7 +768,7 @@ async def get_schema_derived_keys_async(
768768
async def bind_json_schema():
769769
bound_schema = await test_folder.bind_schema_async(
770770
json_schema_uri=SCHEMA_URI,
771-
enable_derived_annos=True
771+
enable_derived_annotations=True
772772
)
773773
return bound_schema
774774
asyncio.run(bind_json_schema())
@@ -782,7 +782,7 @@ async def bind_json_schema():
782782
async def bind_schema_to_file():
783783
bound_schema_file = await example_file.bind_schema_async(
784784
json_schema_uri=SCHEMA_URI,
785-
enable_derived_annos=True
785+
enable_derived_annotations=True
786786
)
787787
return bound_schema_file
788788
asyncio.run(bind_schema_to_file())
@@ -887,7 +887,7 @@ async def get_schema_validation_statistics_async(
887887
async def bind_json_schema():
888888
bound_schema = await test_folder.bind_schema_async(
889889
json_schema_uri=SCHEMA_URI,
890-
enable_derived_annos=True
890+
enable_derived_annotations=True
891891
)
892892
return bound_schema
893893
asyncio.run(bind_json_schema())
@@ -984,7 +984,7 @@ async def get_invalid_validation_async(
984984
async def bind_json_schema():
985985
bound_schema = await test_folder.bind_schema_async(
986986
json_schema_uri=SCHEMA_URI,
987-
enable_derived_annos=True
987+
enable_derived_annotations=True
988988
)
989989
return bound_schema
990990
asyncio.run(bind_json_schema())
@@ -1115,7 +1115,7 @@ def get_invalid_validation(
11151115
async def bind_json_schema():
11161116
bound_schema = await test_folder.bind_schema_async(
11171117
json_schema_uri=SCHEMA_URI,
1118-
enable_derived_annos=True
1118+
enable_derived_annotations=True
11191119
)
11201120
return bound_schema
11211121
asyncio.run(bind_json_schema())

synapseclient/models/protocols/json_schema_protocol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ def bind_schema(
2424
self,
2525
json_schema_uri: str,
2626
*,
27-
enable_derived_annos: bool = False,
27+
enable_derived_annotations: Optional[bool] = False,
2828
synapse_client: Optional["Synapse"] = None,
2929
) -> "JSONSchemaBinding":
3030
"""
3131
Bind a JSON schema to the entity.
3232
3333
Arguments:
3434
json_schema_uri (str): The URI of the JSON schema to bind to the entity.
35-
enable_derived_annos (bool, optional): If true, enable derived annotations. Defaults to False.
35+
enable_derived_annotations (bool, optional): If true, enable derived annotations. Defaults to False.
3636
synapse_client (Optional[Synapse], optional): The Synapse client instance. If not provided,
3737
the last created instance from the Synapse class constructor will be used.
3838

tests/integration/synapseclient/models/async/test_json_schema_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ async def test_get_schema_derived_keys_async(
271271
try:
272272
await created_entity.bind_schema_async(
273273
json_schema_uri=test_product_schema_uri,
274-
enable_derived_annos=True,
274+
enable_derived_annotations=True,
275275
synapse_client=self.syn,
276276
)
277277

tests/integration/synapseclient/models/synchronous/test_json_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def test_get_schema_derived_keys(
271271
try:
272272
created_entity.bind_schema(
273273
json_schema_uri=test_product_schema_uri,
274-
enable_derived_annos=True,
274+
enable_derived_annotations=True,
275275
synapse_client=self.syn,
276276
)
277277

0 commit comments

Comments
 (0)