Skip to content

Commit

Permalink
[skip ci] Modularize and ref runs assembly.
Browse files Browse the repository at this point in the history
  • Loading branch information
aj-stein-nist committed Jan 25, 2024
1 parent bf59a24 commit b46301a
Showing 1 changed file with 28 additions and 24 deletions.
52 changes: 28 additions & 24 deletions schema/metaschema/sarif_metaschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,40 @@
<namespace>http://csrc.nist.gov/ns/oscal/metaschema/validation/results/1.0</namespace>
<!-- TODO: Ditto here, this is the URL for the official spec release version. -->
<json-base-uri>http://csrc.nist.gov/ns/oscal/metaschema/validation/results/1.0</json-base-uri>
<define-field name="version">
<formal-name>SARIF Model Version</formal-name>
<description>The version of the SARIF Model used for conforming instances.</description>
<constraint>
<allowed-values target="." allow-other="no">
<enum value="2.1.0"/>
</allowed-values>
</constraint>
</define-field>
<define-assembly name="tool">
<model>
<define-assembly name="driver">
<model>
<define-field name="name"/>
</model>
</define-assembly>
</model>
</define-assembly>
<define-assembly name="run">
<formal-name>Run</formal-name>
<description>Data about the run of a tool.</description>
<model>
<assembly ref="tool"/>
</model>
</define-assembly>
<define-assembly name="root">
<formal-name>Root Placeholder</formal-name>
<description>A placeholder assembly to wrap the root of the SARIF instance.</description>
<root-name>root</root-name>
<model>
<define-field name="version" min-occurs="1" max-occurs="1">
<formal-name>SARIF Model Version</formal-name>
<description>The version of the SARIF Model used for conforming instances.</description>
<constraint>
<allowed-values target="." allow-other="no">
<enum value="2.1.0"/>
</allowed-values>
</constraint>
</define-field>
<define-assembly name="run" min-occurs="0" max-occurs="unbounded">
<formal-name>Run</formal-name>
<description>Data about the run of a tool.</description>
<field ref="version" min-occurs="1" max-occurs="1"/>
<assembly ref="run" min-occurs="0" max-occurs="unbounded">
<group-as name="runs" in-json="ARRAY" />
<model>
<define-assembly name="tool">
<model>
<define-assembly name="driver">
<model>
<define-field name="name"/>
</model>
</define-assembly>
</model>
</define-assembly>
</model>
</define-assembly>
</assembly>
</model>
<remarks>
<p>Note, this is a workaround because Metaschema does not support anonymous top-level assembly without a key name.</p>
Expand Down

0 comments on commit b46301a

Please sign in to comment.