Skip to content

Commit cce3480

Browse files
Added validation contraints and updated additionalProperties usage
Signed-off-by: Natalia Luzuriaga <natalia.luzuriaga@cms.hhs.gov>
1 parent f1e54bd commit cce3480

1 file changed

Lines changed: 19 additions & 10 deletions

File tree

schemas/schema-2.0.0.json

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"$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": [
@@ -137,17 +138,20 @@
137138
},
138139
"laborHours": {
139140
"type": "number",
141+
"minimum": 0,
140142
"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"
141143
},
142144
"reuseFrequency": {
143145
"type": "object",
144146
"description": "Measures frequency of code reuse in various forms. (e.g. forks, downloads, clones)",
145147
"properties": {
146148
"forks": {
147-
"type": "integer"
149+
"type": "integer",
150+
"minimum": 0
148151
},
149152
"clones": {
150-
"type": "integer"
153+
"type": "integer",
154+
"minimum": 0
151155
}
152156
},
153157
"additionalProperties": true
@@ -157,7 +161,8 @@
157161
"description": "Programming languages that make up the codebase",
158162
"items": {
159163
"type": "string"
160-
}
164+
},
165+
"uniqueItems": true
161166
},
162167
"maintenance": {
163168
"type": "string",
@@ -174,7 +179,8 @@
174179
"description": "Contract number(s) under which the project was developed",
175180
"items": {
176181
"type": "string"
177-
}
182+
},
183+
"uniqueItems": true
178184
},
179185
"SBOM": {
180186
"type": "string",
@@ -199,14 +205,16 @@
199205
"format": "date-time",
200206
"description": "Date when metadata was last updated"
201207
}
202-
}
208+
},
209+
"additionalProperties": false
203210
},
204211
"tags": {
205212
"type": "array",
206213
"description": "Topics and keywords associated with the project to improve search and discoverability",
207214
"items": {
208215
"type": "string"
209-
}
216+
},
217+
"uniqueItems": true
210218
},
211219
"contact": {
212220
"type": "object",
@@ -221,7 +229,8 @@
221229
"type": "string",
222230
"description": "Name of the point of contact"
223231
}
224-
}
232+
},
233+
"additionalProperties": false
225234
},
226235
"feedbackMechanism": {
227236
"type": "string",

0 commit comments

Comments
 (0)