Skip to content

Commit 8e6f934

Browse files
committed
Add MC2 schemas
1 parent d0195c0 commit 8e6f934

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

scripts/write_jsonschemas_to_table.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ def main():
2424
"""
2525
syn = synapseclient.login()
2626
# json_schema_organizations = ["sage.schemas.v2571", "sage.schemas.v2581"]
27-
json_schema_organizations = ["sage.schemas.v2571", "sage.schemas.v2581"]
27+
json_schema_organizations = [
28+
"sage.schemas.v2571",
29+
"sage.schemas.v2581",
30+
"MultiConsortiaCoordinatingCenter",
31+
]
2832
js = syn.service("json_schema")
2933
to_write_schemas = []
3034
for organization_name in json_schema_organizations:
@@ -38,6 +42,7 @@ def main():
3842
)
3943
try:
4044
for version in versions:
45+
print(version)
4146
if (
4247
(
4348
version["schemaName"].startswith("ad")
@@ -51,12 +56,20 @@ def main():
5156
or ".validation." in version["schemaName"]
5257
):
5358
continue
59+
if organization_name == "MultiConsortiaCoordinatingCenter":
60+
# only include the latest version of MCC schemas
61+
dcc = "MC2"
62+
datatype = version["schemaName"]
63+
else:
64+
dcc = version["schemaName"].split(".")[0]
65+
datatype = version["schemaName"].split(".")[1]
66+
5467
to_write_schemas.append(
5568
{
5669
"org": organization_name,
5770
"name": version["schemaName"],
58-
"dcc": version["schemaName"].split(".")[0],
59-
"datatype": version["schemaName"].split(".")[1],
71+
"dcc": dcc,
72+
"datatype": datatype,
6073
"uri": version["$id"],
6174
"version": version["semanticVersion"],
6275
"link": f"https://repo-prod.prod.sagebase.org/repo/v1/schema/type/registered/{version['$id']}",

0 commit comments

Comments
 (0)