Skip to content

Commit a33d04f

Browse files
Merge pull request #33 from DSACMS/nat/validation
Added Tests + Schema Updates
2 parents e9f74ed + cb5990f commit a33d04f

9 files changed

Lines changed: 280 additions & 188 deletions

File tree

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: json-validate
1+
name: json-schema-tests
22
on:
33
pull_request:
44
types: [opened, synchronize]
@@ -11,7 +11,7 @@ permissions:
1111
pull-requests: write # enable write permissions for pull request comments
1212

1313
jobs:
14-
json-yaml-validate:
14+
json-validate:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
@@ -22,3 +22,17 @@ jobs:
2222
with:
2323
comment: "true"
2424
json_schema_version: "draft-04"
25+
26+
schema-tests:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Install the JSON Schema CLI
32+
uses: sourcemeta/jsonschema@v11.1.1
33+
34+
- name: Run generic schema unit tests
35+
run: jsonschema test tests/gov-schema.json --resolve schemas/schema-2.0.0.json
36+
37+
- name: Run CMS schema unit tests
38+
run: jsonschema test tests/cms-schema.json --resolve schemas/cms/schema-0.2.0.json

code.json

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
{
22
"name": "gov-codejson",
33
"description": "code.json: An agency-wide metadata standard for software projects",
4-
"longDescription": "This repository contains documentation on code.json, a metadata standard used to collect information on the agency's software projects in compliance with M-16-21 and the SHARE IT Act.",
4+
"longDescription": "This repository contains documentation on code.json, a metadata standard used to collect information on agency software projects in compliance with M-16-21 and the SHARE IT Act.",
55
"status": "Production",
66
"permissions": {
7-
"license": [
7+
"licenses": [
88
{
9-
"name": "CC0 1.0 Universal",
9+
"name": "CC0-1.0",
1010
"URL": "https://github.com/DSACMS/gov-codejson/blob/main/LICENSE"
1111
}
1212
],
13-
"usageType": "openSource",
13+
"usageType": [
14+
"openSource"
15+
],
1416
"exemptionText": ""
1517
},
1618
"organization": "Centers for Medicare & Medicaid Services",
1719
"repositoryURL": "https://github.com/DSACMS/gov-codejson",
20+
"repositoryHost": "github.com/DSACMS",
21+
"repositoryVisibility": "public",
1822
"vcs": "git",
1923
"laborHours": 3479,
24+
"reuseFrequency": {
25+
"forks": 2
26+
},
2027
"platforms": [
2128
"web"
2229
],
@@ -26,15 +33,20 @@
2633
],
2734
"softwareType": "standalone/web",
2835
"languages": [
29-
"Markdown"
36+
"javascript"
3037
],
31-
"maintenance": "internal",
38+
"maintenance": "community",
39+
"contractNumber": [],
3240
"date": {
3341
"created": "2025-02-04T21:59:53Z",
34-
"lastModified": "2025-02-11T18:45:30Z",
35-
"metaDataLastUpdated": "2025-02-11T18:47:02.924Z"
42+
"lastModified": "2025-08-13T22:27:54Z",
43+
"metaDataLastUpdated": "2025-08-15T16:41:02.063Z"
3644
},
3745
"tags": [
46+
"dsacms-tier3",
47+
"government",
48+
"json",
49+
"metadata-standard",
3850
"guide",
3951
"codejson",
4052
"OSPO",
@@ -46,17 +58,23 @@
4658
"email": "opensource@cms.hhs.gov",
4759
"name": "CMS Open Source Team"
4860
},
61+
"feedbackMechanism": "https://github.com/DSACMS/gov-codejson/issues",
62+
"AIUseCaseID": "0",
4963
"localisation": false,
5064
"repositoryType": "standards",
5165
"userInput": false,
52-
"fismaLevel": "Low",
66+
"fismaLevel": "low",
5367
"group": "CMS/OA/DSAC",
68+
"projects": [
69+
"SHARE IT Act"
70+
],
71+
"systems": [],
72+
"upstream": "https://github.com/DSACMS/gov-codejson/network/dependencies",
5473
"subsetInHealthcare": [
55-
"Operational"
74+
"operational"
5675
],
5776
"userType": [
58-
"Government"
77+
"government"
5978
],
60-
"repositoryHost": "github.com/DSACMS",
6179
"maturityModelTier": 3
6280
}

docs/examples.md

Lines changed: 13 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -1,175 +1,25 @@
11
# Examples of code.json
22

3-
Below are good examples of metadata in CMS code.json files. We hope it helps when creating your repository-level code.json file.
3+
Below are examples of well-structured and comprehensive metadata in CMS code.json files. These examples demonstrate best practices for repository-level metadata documentation.
4+
5+
For additional reference, the [tests directory](../schemas/tests) contain unit tests of code.json files from various DSACMS repositories. These tests help ensure consistency and compliance as we make future updates to the schemas.
6+
7+
We encourage you to review these examples and tests when creating or updating your repository-level code.json file to maintain consistency with federal standards.
48

59
## Example 1: [DedupliFHIR](https://github.com/DSACMS/dedupliFHIR)
610

711
DedupliFHIR is a desktop app tool that uses AI deduplication to identify duplicates in patient records. It is a [tier 3](https://github.com/DSACMS/repo-scaffolder/blob/dev/maturity-model-tiers.md#tier-information) project launched in production that receives user input.
812

9-
```
10-
{
11-
"name": "dedupliFHIR",
12-
"description": "Prototype for basic deduplication and aggregation of eCQM data",
13-
"longDescription": "A CLI bundled with an electron front-end that provides data-linkage and AI deduplication for reported ACO data at scale.",
14-
"status": "Production",
15-
"permissions": {
16-
"license": [
17-
{
18-
"name": "CC0 1.0 Universal",
19-
"URL": "https://github.com/DSACMS/dedupliFHIR/blob/main/LICENSE"
20-
}
21-
],
22-
"usageType": "openSource",
23-
"exemptionText": ""
24-
},
25-
"organization": "Centers for Medicare & Medicaid Services",
26-
"repositoryURL": "https://github.com/DSACMS/dedupliFHIR",
27-
"projectURL": "",
28-
"repositoryHost": "github.com/DSACMS",
29-
"repositoryVisibility": "public",
30-
"vcs": "git",
31-
"laborHours": 4271,
32-
"reuseFrequency": {
33-
"forks": 3,
34-
"clones": 0
35-
},
36-
"platforms": [
37-
"windows",
38-
"mac",
39-
"linux"
40-
],
41-
"categories": [
42-
"data-analytics",
43-
"application-development",
44-
"data-collection"
45-
],
46-
"softwareType": "standalone/desktop",
47-
"languages": [
48-
"Python",
49-
"JavaScript",
50-
"HTML",
51-
"CSS",
52-
"Shell",
53-
"Makefile"
54-
],
55-
"maintenance": "internal",
56-
"contractNumber": [],
57-
"date": {
58-
"created": "2023-06-22T17:08:19Z",
59-
"lastModified": "2025-02-13T18:44:26Z",
60-
"metaDataLastUpdated": "2025-06-10T14:55:32.836Z"
61-
},
62-
"tags": [
63-
"AI",
64-
"deduplication",
65-
"data",
66-
"ACA",
67-
"FHIR",
68-
"featured"
69-
],
70-
"contact": {
71-
"email": "opensource@cms.hhs.gov",
72-
"name": "CMS Open Source Team"
73-
},
74-
"feedbackMechanisms": "https://github.com/DSACMS/dedupliFHIR/issues",
75-
"AIUseCaseID": "0",
76-
"localisation": false,
77-
"repositoryType": "application",
78-
"userInput": "true",
79-
"fismaLevel": "Moderate",
80-
"group": "CMS/OA/DSAC",
81-
"projects": [],
82-
"systems": [],
83-
"upstream": "https://github.com/DSACMS/dedupliFHIR/network/dependencies",
84-
"subsetInHealthcare": [
85-
"Operational"
86-
],
87-
"userType": [
88-
"Providers"
89-
],
90-
"maturityModelTier": "3"
91-
}
92-
```
13+
Link to code.json file: [codejson-example-dedupliFHIR.json](https://github.com/DSACMS/gov-codejson/blob/main/tests/examples/codejson-example-dedupliFHIR.json)
9314

9415
## Example 2: [CMS Metrics Website](https://github.com/DSACMS/metrics)
9516

9617
The CMS Metrics Website is a [tier 3](https://github.com/DSACMS/repo-scaffolder/blob/dev/maturity-model-tiers.md#tier-information) project where government employees can view repository metrics on CMS open source projects, currently maintained by the CMS OSPO.
9718

98-
```
99-
{
100-
"name": "metrics",
101-
"description": "CMS Open Source Repository Metrics Website",
102-
"longDescription": "The CMS Repository Metrics Website shows an overview of software development activity across open source projects within a specified organization. It is designed for developers and program managers interested in monitoring health and activity of CMS open source repositories.",
103-
"status": "Production",
104-
"permissions": {
105-
"license": [
106-
{
107-
"name": "CC0 1.0 Universal",
108-
"URL": "https://github.com/DSACMS/metrics/blob/main/LICENSE.md"
109-
}
110-
],
111-
"usageType": "openSource",
112-
"exemptionText": ""
113-
},
114-
"organization": "Centers for Medicare & Medicaid Services",
115-
"repositoryURL": "https://github.com/DSACMS/metrics",
116-
"projectURL": "https://dsacms.github.io/metrics/",
117-
"repositoryHost": "github.com/DSACMS",
118-
"repositoryVisibility": "public",
119-
"vcs": "git",
120-
"laborHours": 20722,
121-
"reuseFrequency": {
122-
"forks": 4,
123-
"clones": 0
124-
},
125-
"platforms": [
126-
"web"
127-
],
128-
"categories": [
129-
"data-visualization",
130-
"data-analytics"
131-
],
132-
"softwareType": "standalone/web",
133-
"languages": [
134-
"Liquid",
135-
"JavaScript",
136-
"CSS",
137-
"Python",
138-
"Shell"
139-
],
140-
"maintenance": "internal",
141-
"contractNumber": [],
142-
"date": {
143-
"created": "2023-07-18T14:10:58Z",
144-
"lastModified": "2025-06-01T11:36:12Z",
145-
"metaDataLastUpdated": "2025-06-06T16:36:38.949Z"
146-
},
147-
"tags": [
148-
"metrics",
149-
"ospo",
150-
"repository",
151-
"featured"
152-
],
153-
"contact": {
154-
"email": "opensource@cms.hhs.gov",
155-
"name": "CMS/OA/DSAC/OSPO"
156-
},
157-
"feedbackMechanisms": "https://github.com/DSACMS/metrics/issues",
158-
"AIUseCaseID": "0",
159-
"localisation": false,
160-
"repositoryType": "website",
161-
"userInput": "No",
162-
"fismaLevel": "Low",
163-
"group": "CMS/OA/DSAC",
164-
"projects": [],
165-
"systems": [],
166-
"upstream": "https://github.com/DSACMS/metrics/network/dependencies",
167-
"subsetInHealthcare": [
168-
"Operational"
169-
],
170-
"userType": [
171-
"Government"
172-
],
173-
"maturityModelTier": 3
174-
}
175-
```
19+
Link to code.json file: [codejson-example-metrics.json](https://github.com/DSACMS/gov-codejson/blob/main/tests/examples/codejson-example-metrics.json)
20+
21+
## Example 3: [gov-codejson](https://github.com/DSACMS/gov-codejson)
22+
23+
gov-codejson (this repository!) is a [tier 3](https://github.com/DSACMS/repo-scaffolder/blob/dev/maturity-model-tiers.md#tier-information) project containing documentation on the code.json metadata standard, currently maintained by the federal government community.
24+
25+
Link to code.json file: [code.json](https://github.com/DSACMS/gov-codejson/blob/main/code.json)

schemas/cms/schema-0.2.0.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,9 @@
317317
"type": "string",
318318
"description": "Level of security categorization assigned to an information system under the Federal Information Security Modernization Act (FISMA): https://security.cms.gov/learn/federal-information-security-modernization-act-fisma",
319319
"enum": [
320-
"Low",
321-
"Moderate",
322-
"High"
320+
"low",
321+
"moderate",
322+
"high"
323323
]
324324
},
325325
"group": {
@@ -349,10 +349,10 @@
349349
"items": {
350350
"type": "string",
351351
"enum": [
352-
"Policy",
353-
"Operational",
354-
"Medicare",
355-
"Medicaid"
352+
"policy",
353+
"operational",
354+
"medicare",
355+
"medicaid"
356356
]
357357
},
358358
"description": "Healthcare-related subset"
@@ -362,9 +362,9 @@
362362
"items": {
363363
"type": "string",
364364
"enum": [
365-
"Providers",
366-
"Patients",
367-
"Government"
365+
"providers",
366+
"patients",
367+
"government"
368368
]
369369
},
370370
"description": "Types of users who interact with the software"

schemas/schema-2.0.0.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@
151151
},
152152
"additionalProperties": true
153153
},
154+
"languages": {
155+
"type": "array",
156+
"description": "Programming languages that make up the codebase",
157+
"items": {
158+
"type": "string"
159+
}
160+
},
154161
"maintenance": {
155162
"type": "string",
156163
"description": "The dedicated staff that keeps the software up-to-date, if any",
@@ -241,5 +248,5 @@
241248
"feedbackMechanism",
242249
"AIUseCaseID"
243250
],
244-
"additionalProperties": false
251+
"additionalProperties": true
245252
}

tests/cms-schema.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"target": "../schemas/cms/schema-0.2.0.json",
3+
"$comment": "This test suite validates code.json files for compliance with the CMS schema requirements.",
4+
"tests": [
5+
{
6+
"description": "Example 1: DedupliFHIR",
7+
"valid": true,
8+
"dataPath": "./examples/codejson-example-dedupliFHIR.json"
9+
},
10+
{
11+
"description": "Example 2: metrics",
12+
"valid": true,
13+
"dataPath": "./examples/codejson-example-metrics.json"
14+
},
15+
{
16+
"description": "Example 3: gov-codejson",
17+
"valid": true,
18+
"dataPath": "../code.json"
19+
}
20+
]
21+
}

0 commit comments

Comments
 (0)