Skip to content

Commit 6556bf0

Browse files
Merge pull request #36 from DSACMS/nat/schema-major-updates
Schemas: Update schema to use JSON v2020-12 and validation
2 parents 3e4db48 + 6507306 commit 6556bf0

6 files changed

Lines changed: 71 additions & 39 deletions

File tree

‎.github/workflows/json-schema-tests.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: GrantBirki/json-yaml-validate@v3.3.2 # replace with the latest version
2222
with:
2323
comment: "true"
24-
json_schema_version: "draft-04"
24+
json_schema_version: "draft-2020-12"
2525

2626
schema-tests:
2727
runs-on: ubuntu-latest

‎code.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
],
3838
"maintenance": "community",
3939
"contractNumber": [],
40+
"SBOM": "https://github.com/DSACMS/gov-codejson/network/dependencies",
4041
"date": {
4142
"created": "2025-02-04T21:59:53Z",
4243
"lastModified": "2025-08-13T22:27:54Z",
@@ -69,7 +70,6 @@
6970
"SHARE IT Act"
7071
],
7172
"systems": [],
72-
"upstream": "https://github.com/DSACMS/gov-codejson/network/dependencies",
7373
"subsetInHealthcare": [
7474
"operational"
7575
],

‎schemas/cms/schema-0.2.0.json‎

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/schema#",
3-
"title": "CMS Code.json Metadata",
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://dsacms.github.io/code-json-schema.json",
4+
"title": "CMS code.json metadata",
45
"description": "A metadata standard for software repositories of CMS",
56
"type": "object",
67
"properties": {
@@ -70,7 +71,8 @@
7071
"required": [
7172
"name",
7273
"URL"
73-
]
74+
],
75+
"additionalProperties": false
7476
}
7577
},
7678
"usageType": {
@@ -95,8 +97,7 @@
9597
"exemptByPolicyDate"
9698
]
9799
},
98-
"description": "A list of enumerated values which describes the usage permissions for the release: (1) openSource: Open source; (2) governmentWideReuse: Government-wide reuse; (3) exemptByNationalSecurity: The source code is primarily for use in national security system as defined in section 11103 of title 40, USC; (4) exemptByNationalIntelligence: The source code is developed by an agency or part of an agency that is an element of the intelligence community, as defined in section 3(4) of the National Security Act of 1947; (5) exemptByFOIA: The source code is exempt under the Freedom of Information Act; (6) exemptByEAR: The source code is exempt under the Export Administration Regulations; (7) exemptByITAR: The source code is exempt under the the International Traffic in Arms Regulations; (8) exemptByTSA: The source code is exempt under the regulations of the Transportation Security Administration relating to the protection of Sensitive Security Information; (9) exemptByClassifiedInformation: The source code is exempt under the Federal laws and regulations governing the sharing of classified information not covered by exemptByNationalSecurity, exemptByNationalIntelligence, exemptbyFOIA, exemptByEAR, exemptByITAR, and exemptByTSA; (10) exemptByPrivacyRisk: The sharing or public accessibility of the source code would create an identifiable risk to the privacy of an individual; (11) exemptByIPRestriction: The sharing of the source code is limited by patent or intellectual property restrictions; (12) exemptByAgencySystem: The sharing of the source code would create an identifiable risk to the stability, security, or integrity of the agency’s systems or personnel; (13) exemptByAgencyMission: The sharing of the source code would create an identifiable risk to agency mission, programs, or operations; (14) exemptByCIO: The CIO believes it is in the national interest to exempt sharing the source code; (15) exemptByPolicyDate: The release was created prior to the M-16-21 policy (August 8, 2016)",
99-
"additionalProperties": false
100+
"description": "A list of enumerated values which describes the usage permissions for the release: (1) openSource: Open source; (2) governmentWideReuse: Government-wide reuse; (3) exemptByNationalSecurity: The source code is primarily for use in national security system as defined in section 11103 of title 40, USC; (4) exemptByNationalIntelligence: The source code is developed by an agency or part of an agency that is an element of the intelligence community, as defined in section 3(4) of the National Security Act of 1947; (5) exemptByFOIA: The source code is exempt under the Freedom of Information Act; (6) exemptByEAR: The source code is exempt under the Export Administration Regulations; (7) exemptByITAR: The source code is exempt under the the International Traffic in Arms Regulations; (8) exemptByTSA: The source code is exempt under the regulations of the Transportation Security Administration relating to the protection of Sensitive Security Information; (9) exemptByClassifiedInformation: The source code is exempt under the Federal laws and regulations governing the sharing of classified information not covered by exemptByNationalSecurity, exemptByNationalIntelligence, exemptbyFOIA, exemptByEAR, exemptByITAR, and exemptByTSA; (10) exemptByPrivacyRisk: The sharing or public accessibility of the source code would create an identifiable risk to the privacy of an individual; (11) exemptByIPRestriction: The sharing of the source code is limited by patent or intellectual property restrictions; (12) exemptByAgencySystem: The sharing of the source code would create an identifiable risk to the stability, security, or integrity of the agency's systems or personnel; (13) exemptByAgencyMission: The sharing of the source code would create an identifiable risk to agency mission, programs, or operations; (14) exemptByCIO: The CIO believes it is in the national interest to exempt sharing the source code; (15) exemptByPolicyDate: The release was created prior to the M-16-21 policy (August 8, 2016)"
100101
},
101102
"exemptionText": {
102103
"type": [
@@ -157,22 +158,26 @@
157158
"hg",
158159
"svn",
159160
"rcs",
160-
"bzr"
161+
"bzr",
162+
"none"
161163
]
162164
},
163165
"laborHours": {
164166
"type": "number",
167+
"minimum": 0,
165168
"description": "Labor hours invested in the project. Calculated using COCOMO measured by the SCC tool: https://github.com/boyter/scc?tab=readme-ov-file#cocomo"
166169
},
167170
"reuseFrequency": {
168171
"type": "object",
169172
"description": "Measures frequency of code reuse in various forms. (e.g. forks, downloads, clones)",
170173
"properties": {
171174
"forks": {
172-
"type": "integer"
175+
"type": "integer",
176+
"minimum": 0
173177
},
174178
"clones": {
175-
"type": "integer"
179+
"type": "integer",
180+
"minimum": 0
176181
}
177182
},
178183
"additionalProperties": true
@@ -191,14 +196,16 @@
191196
"android",
192197
"other"
193198
]
194-
}
199+
},
200+
"uniqueItems": true
195201
},
196202
"categories": {
197203
"type": "array",
198204
"description": "Categories the project belongs to. Select from: https://yml.publiccode.tools/categories-list.html",
199205
"items": {
200206
"type": "string"
201-
}
207+
},
208+
"uniqueItems": true
202209
},
203210
"softwareType": {
204211
"type": "string",
@@ -220,7 +227,8 @@
220227
"description": "Programming languages that make up the codebase",
221228
"items": {
222229
"type": "string"
223-
}
230+
},
231+
"uniqueItems": true
224232
},
225233
"maintenance": {
226234
"type": "string",
@@ -237,7 +245,12 @@
237245
"description": "Contract number(s) under which the project was developed",
238246
"items": {
239247
"type": "string"
240-
}
248+
},
249+
"uniqueItems": true
250+
},
251+
"SBOM": {
252+
"type": "string",
253+
"description": "Link of the upstream repositories and dependencies used, in the form of a Software Bill of Materials/SBOM. If the software does not have a SBOM, enter 'None'. (i.e. Github provides an SBOM: https://github.com/$ORG_NAME/$REPO_NAME/network/dependencies)"
241254
},
242255
"date": {
243256
"type": "object",
@@ -258,14 +271,16 @@
258271
"format": "date-time",
259272
"description": "Date when metadata was last updated"
260273
}
261-
}
274+
},
275+
"additionalProperties": false
262276
},
263277
"tags": {
264278
"type": "array",
265279
"description": "Topics and keywords associated with the project to improve search and discoverability",
266280
"items": {
267281
"type": "string"
268-
}
282+
},
283+
"uniqueItems": true
269284
},
270285
"contact": {
271286
"type": "object",
@@ -280,7 +295,8 @@
280295
"type": "string",
281296
"description": "Name of the point of contact"
282297
}
283-
}
298+
},
299+
"additionalProperties": false
284300
},
285301
"feedbackMechanism": {
286302
"type": "string",
@@ -331,18 +347,16 @@
331347
"description": "Project(s) that is associated or related to the repository, if any (e.g. Bluebutton, MPSM)",
332348
"items": {
333349
"type": "string"
334-
}
350+
},
351+
"uniqueItems": true
335352
},
336353
"systems": {
337354
"type": "array",
338355
"description": "CMS systems that the repository interfaces with or depends on, if any (e.g. IDR, PECOS)",
339356
"items": {
340357
"type": "string"
341-
}
342-
},
343-
"upstream": {
344-
"type": "string",
345-
"description": "Link of the upstream repositories and dependencies used, in the form of a Software Bill of Materials/SBOM (https://github.com/$ORG_NAME/$REPO_NAME/network/dependencies)"
358+
},
359+
"uniqueItems": true
346360
},
347361
"subsetInHealthcare": {
348362
"type": "array",
@@ -355,7 +369,8 @@
355369
"medicaid"
356370
]
357371
},
358-
"description": "Healthcare-related subset"
372+
"description": "Healthcare-related subset",
373+
"uniqueItems": true
359374
},
360375
"userType": {
361376
"type": "array",
@@ -367,7 +382,8 @@
367382
"government"
368383
]
369384
},
370-
"description": "Types of users who interact with the software"
385+
"description": "Types of users who interact with the software",
386+
"uniqueItems": true
371387
},
372388
"maturityModelTier": {
373389
"type": "integer",
@@ -400,6 +416,7 @@
400416
"languages",
401417
"maintenance",
402418
"contractNumber",
419+
"SBOM",
403420
"date",
404421
"tags",
405422
"contact",

‎schemas/schema-2.0.0.json‎

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/schema#",
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"$id": "https://dsacms.github.io/code-json-schema.json",
34
"title": "code.json metadata",
45
"description": "A metadata standard for software repositories",
56
"type": "object",
@@ -64,7 +65,8 @@
6465
"required": [
6566
"name",
6667
"URL"
67-
]
68+
],
69+
"additionalProperties": false
6870
}
6971
},
7072
"usageType": {
@@ -89,8 +91,7 @@
8991
"exemptByPolicyDate"
9092
]
9193
},
92-
"description": "A list of enumerated values which describes the usage permissions for the release: (1) openSource: Open source; (2) governmentWideReuse: Government-wide reuse; (3) exemptByNationalSecurity: The source code is primarily for use in national security system as defined in section 11103 of title 40, USC; (4) exemptByNationalIntelligence: The source code is developed by an agency or part of an agency that is an element of the intelligence community, as defined in section 3(4) of the National Security Act of 1947; (5) exemptByFOIA: The source code is exempt under the Freedom of Information Act; (6) exemptByEAR: The source code is exempt under the Export Administration Regulations; (7) exemptByITAR: The source code is exempt under the the International Traffic in Arms Regulations; (8) exemptByTSA: The source code is exempt under the regulations of the Transportation Security Administration relating to the protection of Sensitive Security Information; (9) exemptByClassifiedInformation: The source code is exempt under the Federal laws and regulations governing the sharing of classified information not covered by exemptByNationalSecurity, exemptByNationalIntelligence, exemptbyFOIA, exemptByEAR, exemptByITAR, and exemptByTSA; (10) exemptByPrivacyRisk: The sharing or public accessibility of the source code would create an identifiable risk to the privacy of an individual; (11) exemptByIPRestriction: The sharing of the source code is limited by patent or intellectual property restrictions; (12) exemptByAgencySystem: The sharing of the source code would create an identifiable risk to the stability, security, or integrity of the agency’s systems or personnel; (13) exemptByAgencyMission: The sharing of the source code would create an identifiable risk to agency mission, programs, or operations; (14) exemptByCIO: The CIO believes it is in the national interest to exempt sharing the source code; (15) exemptByPolicyDate: The release was created prior to the M-16-21 policy (August 8, 2016)",
93-
"additionalProperties": false
94+
"description": "A list of enumerated values which describes the usage permissions for the release: (1) openSource: Open source; (2) governmentWideReuse: Government-wide reuse; (3) exemptByNationalSecurity: The source code is primarily for use in national security system as defined in section 11103 of title 40, USC; (4) exemptByNationalIntelligence: The source code is developed by an agency or part of an agency that is an element of the intelligence community, as defined in section 3(4) of the National Security Act of 1947; (5) exemptByFOIA: The source code is exempt under the Freedom of Information Act; (6) exemptByEAR: The source code is exempt under the Export Administration Regulations; (7) exemptByITAR: The source code is exempt under the the International Traffic in Arms Regulations; (8) exemptByTSA: The source code is exempt under the regulations of the Transportation Security Administration relating to the protection of Sensitive Security Information; (9) exemptByClassifiedInformation: The source code is exempt under the Federal laws and regulations governing the sharing of classified information not covered by exemptByNationalSecurity, exemptByNationalIntelligence, exemptbyFOIA, exemptByEAR, exemptByITAR, and exemptByTSA; (10) exemptByPrivacyRisk: The sharing or public accessibility of the source code would create an identifiable risk to the privacy of an individual; (11) exemptByIPRestriction: The sharing of the source code is limited by patent or intellectual property restrictions; (12) exemptByAgencySystem: The sharing of the source code would create an identifiable risk to the stability, security, or integrity of the agency's systems or personnel; (13) exemptByAgencyMission: The sharing of the source code would create an identifiable risk to agency mission, programs, or operations; (14) exemptByCIO: The CIO believes it is in the national interest to exempt sharing the source code; (15) exemptByPolicyDate: The release was created prior to the M-16-21 policy (August 8, 2016)"
9495
},
9596
"exemptionText": {
9697
"type": [
@@ -131,22 +132,26 @@
131132
"hg",
132133
"svn",
133134
"rcs",
134-
"bzr"
135+
"bzr",
136+
"none"
135137
]
136138
},
137139
"laborHours": {
138140
"type": "number",
141+
"minimum": 0,
139142
"description": "Labor hours invested in the project. Calculated using COCOMO measured by the SCC tool: https://github.com/boyter/scc?tab=readme-ov-file#cocomo"
140143
},
141144
"reuseFrequency": {
142145
"type": "object",
143146
"description": "Measures frequency of code reuse in various forms. (e.g. forks, downloads, clones)",
144147
"properties": {
145148
"forks": {
146-
"type": "integer"
149+
"type": "integer",
150+
"minimum": 0
147151
},
148152
"clones": {
149-
"type": "integer"
153+
"type": "integer",
154+
"minimum": 0
150155
}
151156
},
152157
"additionalProperties": true
@@ -156,7 +161,8 @@
156161
"description": "Programming languages that make up the codebase",
157162
"items": {
158163
"type": "string"
159-
}
164+
},
165+
"uniqueItems": true
160166
},
161167
"maintenance": {
162168
"type": "string",
@@ -173,7 +179,12 @@
173179
"description": "Contract number(s) under which the project was developed",
174180
"items": {
175181
"type": "string"
176-
}
182+
},
183+
"uniqueItems": true
184+
},
185+
"SBOM": {
186+
"type": "string",
187+
"description": "Link of the upstream repositories and dependencies used, in the form of a Software Bill of Materials/SBOM. If the software does not have a SBOM, enter 'None'. (i.e. Github provides an SBOM: https://github.com/$ORG_NAME/$REPO_NAME/network/dependencies)"
177188
},
178189
"date": {
179190
"type": "object",
@@ -194,14 +205,16 @@
194205
"format": "date-time",
195206
"description": "Date when metadata was last updated"
196207
}
197-
}
208+
},
209+
"additionalProperties": false
198210
},
199211
"tags": {
200212
"type": "array",
201213
"description": "Topics and keywords associated with the project to improve search and discoverability",
202214
"items": {
203215
"type": "string"
204-
}
216+
},
217+
"uniqueItems": true
205218
},
206219
"contact": {
207220
"type": "object",
@@ -216,7 +229,8 @@
216229
"type": "string",
217230
"description": "Name of the point of contact"
218231
}
219-
}
232+
},
233+
"additionalProperties": false
220234
},
221235
"feedbackMechanism": {
222236
"type": "string",
@@ -242,6 +256,7 @@
242256
"languages",
243257
"maintenance",
244258
"contractNumber",
259+
"SBOM",
245260
"date",
246261
"tags",
247262
"contact",

‎tests/examples/codejson-example-dedupliFHIR.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
],
4747
"maintenance": "internal",
4848
"contractNumber": [],
49+
"SBOM": "https://github.com/DSACMS/dedupliFHIR/network/dependencies",
4950
"date": {
5051
"created": "2023-06-22T17:08:19Z",
5152
"lastModified": "2025-02-13T18:44:26Z",
@@ -72,7 +73,6 @@
7273
"group": "CMS/OA/DSAC",
7374
"projects": [],
7475
"systems": [],
75-
"upstream": "https://github.com/DSACMS/dedupliFHIR/network/dependencies",
7676
"subsetInHealthcare": [
7777
"operational"
7878
],

‎tests/examples/codejson-example-metrics.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
],
4444
"maintenance": "internal",
4545
"contractNumber": [],
46+
"SBOM": "https://github.com/DSACMS/metrics/network/dependencies",
4647
"date": {
4748
"created": "2023-07-18T14:10:58Z",
4849
"lastModified": "2025-06-01T11:36:12Z",
@@ -67,7 +68,6 @@
6768
"group": "CMS/OA/DSAC",
6869
"projects": [],
6970
"systems": [],
70-
"upstream": "https://github.com/DSACMS/metrics/network/dependencies",
7171
"subsetInHealthcare": [
7272
"operational"
7373
],

0 commit comments

Comments
 (0)