@@ -210,6 +210,8 @@ async def bind_schema_async(
210
210
211
211
Example: Using this function
212
212
Binding JSON schema to a folder or a file
213
+
214
+ ```python
213
215
import synapseclient
214
216
from synapseclient.models import File, Folder
215
217
import asyncio
@@ -277,7 +279,7 @@ async def bind_schema_to_file():
277
279
)
278
280
return bound_schema_file
279
281
asyncio.run(bind_schema_to_file())
280
-
282
+ ```
281
283
Returns:
282
284
JSONSchemaBinding: An object containing details about the JSON schema binding.
283
285
"""
@@ -319,6 +321,8 @@ async def get_schema_async(
319
321
320
322
Example: Using this function
321
323
Retrieving the bound JSON schema from a folder or file
324
+
325
+ ```python
322
326
import synapseclient
323
327
from synapseclient.models import File, Folder
324
328
import asyncio
@@ -399,7 +403,7 @@ async def get_bound_schema_from_file():
399
403
return bound_schema_file
400
404
bound_schema_file = asyncio.run(get_bound_schema_from_file())
401
405
print("Bound schema from file retrieved:", bound_schema_file)
402
-
406
+ ```
403
407
Returns:
404
408
JSONSchemaBinding: An object containing details about the bound JSON schema.
405
409
"""
@@ -441,6 +445,8 @@ async def unbind_schema_async(
441
445
442
446
Example: Using this function
443
447
Unbinding a JSON schema from a folder or file
448
+
449
+ ```python
444
450
import synapseclient
445
451
from synapseclient.models import File, Folder
446
452
import asyncio
@@ -520,6 +526,7 @@ async def unbind_schema_from_file():
520
526
response = await example_file.unbind_schema_async()
521
527
return response
522
528
unbind_response_file = asyncio.run(unbind_schema_from_file())
529
+ ```
523
530
"""
524
531
return await delete_json_schema_from_entity (
525
532
synapse_id = self .id , synapse_client = synapse_client
@@ -537,6 +544,8 @@ async def validate_schema_async(
537
544
538
545
Example: Using this function
539
546
Validating a folder or file against the bound JSON schema
547
+
548
+ ```python
540
549
import synapseclient
541
550
from synapseclient.models import File, Folder
542
551
import asyncio
@@ -625,6 +634,7 @@ async def validate_file_with_json_schema():
625
634
return response
626
635
validation_response_file = asyncio.run(validate_file_with_json_schema())
627
636
print('validation response:', validation_response_file)
637
+ ```
628
638
Returns:
629
639
Union[JSONSchemaValidation, InvalidJSONSchemaValidation]: The validation results.
630
640
"""
@@ -698,6 +708,8 @@ async def get_schema_derived_keys_async(
698
708
699
709
Example: Using this function
700
710
Retrieving derived keys from a folder or file
711
+
712
+ ```python
701
713
import synapseclient
702
714
from synapseclient.models import File, Folder
703
715
import asyncio
@@ -784,7 +796,7 @@ async def get_schema_derived_keys_from_file():
784
796
derived_keys_file = await example_file.get_schema_derived_keys_async()
785
797
return derived_keys_file
786
798
print('Derived keys from file:', asyncio.run(get_schema_derived_keys_from_file()))
787
-
799
+ ```
788
800
Returns:
789
801
JSONSchemaDerivedKeys: An object containing the derived keys for the entity.
790
802
"""
@@ -815,6 +827,7 @@ async def get_schema_validation_statistics_async(
815
827
Example: Using this function
816
828
Retrieving validation statistics for a folder
817
829
830
+ ```python
818
831
import synapseclient
819
832
from synapseclient.models import File, Folder
820
833
import asyncio
@@ -880,7 +893,7 @@ async def get_validation_statistics():
880
893
881
894
stats = asyncio.run(get_validation_statistics())
882
895
print('Validation statistics:', stats)
883
-
896
+ ```
884
897
Returns:
885
898
JSONSchemaValidationStatistics: The validation statistics.
886
899
"""
@@ -908,6 +921,8 @@ async def get_invalid_validation_async(
908
921
909
922
Example: Using this function
910
923
Retrieving invalid validation results for a folder
924
+
925
+ ```python
911
926
import synapseclient
912
927
from synapseclient.models import File, Folder
913
928
import asyncio
@@ -971,6 +986,7 @@ async def get_invalid_validation_async():
971
986
gen = test_folder.get_invalid_validation_async(synapse_client=syn)
972
987
async for child in gen:
973
988
print(child)
989
+ ```
974
990
975
991
Yields:
976
992
InvalidJSONSchemaValidation: An object containing the validation response, all validation messages,
@@ -1036,6 +1052,8 @@ def get_invalid_validation(
1036
1052
1037
1053
Example: Using this function
1038
1054
Retrieving invalid validation results for a folder
1055
+
1056
+ ```python
1039
1057
import synapseclient
1040
1058
from synapseclient.models import File, Folder
1041
1059
import asyncio
@@ -1098,6 +1116,7 @@ async def bind_json_schema():
1098
1116
invalid_results = test_folder.get_invalid_validation(synapse_client=syn)
1099
1117
for child in invalid_results:
1100
1118
print(child)
1119
+ ```
1101
1120
1102
1121
Yields:
1103
1122
InvalidJSONSchemaValidation: An object containing the validation response, all validation messages,
0 commit comments