-
Notifications
You must be signed in to change notification settings - Fork 222
Description
Describe the bug
The OSCAL 1.2.0 complete schema (oscal_complete_schema.json) contains multiple object definitions that have required fields specified but are missing the corresponding properties field. This appears to be a regression from version 1.1.3, where these same definitions included properties fields.
Who is the bug affecting
For me - it affects my ability to use existing tooling to generate types for programmatic use. I have yet to explore other implications of this schema state.
What is affected by this bug
Metaschema, OSCAL Content
How do we replicate this issue
To find all affected definitions in the schema, you can use this jq query:
jq '[.. | objects | select(type == "object" and has("type") and .type == "object" and has("title") and has("required") and (has("properties") | not)) | .title] | unique' oscal_complete_schema.jsonExpected behavior (i.e. solution)
In OSCAL 1.2.0
{
"additionalProperties": false,
"description": "Relates the finding to a set of referenced observations that were used to determine the finding.",
"required": [
"observation-uuid"
],
"title": "Related Observation",
"type": "object"
}Problem: The required field lists "observation-uuid" but there is no properties field defining what observation-uuid is.
In OSCAL 1.1.3 (WORKING)
{
"additionalProperties": false,
"description": "Relates the finding to a set of referenced observations that were used to determine the finding.",
"properties": {
"observation-uuid": {
"$ref": "#/definitions/UUIDDatatype",
"description": "A machine-oriented identifier reference to an observation defined in the list of observations.",
"title": "Observation Universally Unique Identifier Reference"
}
},
"required": [
"observation-uuid"
],
"title": "Related Observation",
"type": "object"
}I would expect that the properties are present for required or non-required fields.
Other comments
I am far from a schema expert (more so metaschema). Maybe this schema is entirely valid and I have overlooked some aspect of generating types from the schema.
Revisions
No response