syft/schema
Alex Goodman a5cba13ddf
enable more flexible java manifest structure (closer to the spec)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2020-10-29 16:26:04 -04:00
..
cyclonedx add bom descriptor schema + test against xml schemas in pipeline (#163) 2020-08-27 19:12:45 -04:00
json enable more flexible java manifest structure (closer to the spec) 2020-10-29 16:26:04 -04:00
README.md Add support for package.json #200 2020-10-16 11:28:54 -04:00

Updating the JSON schema

Today the JSON schema is generated from integration test data. Specifically, when integration tests are run, the /schema/json/examples directory is populated with syft JSON output data. This examples directory is used to drive automatically generating the JSON schema. The caveats with this approach is:

  1. the JSON schema is only as good as the examples provided
  2. there is an integration test that ensures that the JSON schema is valid relative to what the code currently generates. This means to update the JSON schema you need to
  3. Open up test/integration/json_schema_test.go and comment out invocations of the validateAgainstV1Schema function.
  4. From the root of the repo run generate-json-schema. Now there should be a new schema generated at /schema/json/schema.json
  5. Uncomment the validateAgainstV1Schema function.