VulnCheck.Report.JSON (VulnCheck v1.0.1)

Copy Markdown View Source

Native JSON report (--format json, schema_version 1.0.0).

Keys are sorted and the output is pretty-printed with two spaces, so rendering the same report always produces the same bytes. The document is also accepted as a --baseline.

Summary

Functions

The report as plain maps, lists and scalars.

Encodes a term with sorted object keys and two-space indentation.

Functions

document(report)

@spec document(VulnCheck.Types.ScanReport.t()) :: map()

The report as plain maps, lists and scalars.

encode(value, level \\ 0)

@spec encode(term(), non_neg_integer()) :: String.t()

Encodes a term with sorted object keys and two-space indentation.

iex> VulnCheck.Report.JSON.encode(%{"b" => [1, %{}], "a" => nil})
"{\n  \"a\": null,\n  \"b\": [\n    1,\n    {}\n  ]\n}"