Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Finalize JSON output & add JSON schema #118

Merged
merged 2 commits into from
Aug 4, 2020
Merged

Conversation

wagoodman
Copy link
Contributor

Finalizes the json output format:

  • fixes the image.layers to populate layer content
  • pretty prints the json output --this does make the output larger, but more comprehensible for diffing and groking snapshots and output in general.
  • renames source -> directory
  • adds struct tags to defend output against variable name refactors (which should not impact the schema)
  • enhances (and fixes) APK files output to include more metadata

In general this PR adds:

  • a JSON schema to validate the JSON presenter output and act as a contract for external users to build tooling against
  • integration tests which generate json output examples from the existing package cases, and validates the JSON presenter output against the JSON schema
  • a generate.py script and generate-json-schema make target for easily updating the json schema from integration test output

Future PR:

  • add detection of presenter additions that could be incorporated into the schema, ensuring the schema is as up to date as possible.

Closes #105
Closes #104

@wagoodman wagoodman merged commit e2a874a into master Aug 4, 2020
@wagoodman wagoodman deleted the finalize-json-presenter branch August 4, 2020 20:05
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Finalize json presenter schema Add json struct tags to package metadata
2 participants