From 3081ce92c9281cb58f5b07a171169ba55ffe7b96 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2026 07:09:02 +0000 Subject: [PATCH 1/2] docs: document YAML input for attest custom --- getting_started/attestations.md | 15 +++++++++++---- tutorials/attest_custom.md | 2 ++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/getting_started/attestations.md b/getting_started/attestations.md index 0102f2bb..1757af6a 100644 --- a/getting_started/attestations.md +++ b/getting_started/attestations.md @@ -172,7 +172,7 @@ All `kosli attest` commands support flags for attaching additional data. These f |------|-------------|---------| | `--user-data` | All evidence attest commands | Attach structured JSON metadata that is stored and visible alongside the attestation in the Kosli UI | | `--attachments` | All evidence attest commands | Upload files or directories to the Evidence Vault as compressed archives for later download | -| `--attestation-data` | `attest custom` only | Provide the JSON payload that the custom type's jq rules evaluate to determine compliance | +| `--attestation-data` | `attest custom` only | Provide the JSON or YAML file that the custom type's jq rules evaluate to determine compliance | | `--annotate` | All evidence attest commands | Attach `key=value` annotations that are displayed as a label/value pair on the attestation in the Kosli UI | ### When to use which @@ -205,12 +205,19 @@ kosli attest generic \ --attachments scan-report.html,scan-config.yml ``` -Use **`--attestation-data`** on `kosli attest custom` to provide the JSON data that the custom +Use **`--attestation-data`** on `kosli attest custom` to provide the data that the custom attestation type's jq expression evaluates. This is what determines the compliance status of the attestation. See the [Custom](#custom) attestation type below for details. -The `--attestation-data` JSON payload sent to Kosli is limited to 1 MB; larger payloads fail with a -400 error. For larger reports, distill the data you need into a summary and attach the full document +The file can be JSON or YAML. The CLI picks the format from the file extension: it converts a +`.yaml` or `.yml` file to JSON before sending it, and reads any other file as JSON. In YAML, a number +with a leading zero is read as octal, so quote version-like values and codes (`"1.10"`, `"0123"`) +to keep them as written. A YAML file with several documents needs `--attestation-data-as-list`, +which sends the documents as a JSON list. See +[`kosli attest custom`](/client_reference/kosli_attest_custom) for the full conversion rules. + +The `--attestation-data` JSON payload sent to Kosli is limited to 1 MB, measured after any YAML +conversion; larger payloads fail with a 400 error. For larger reports, distill the data you need into a summary and attach the full document separately — see [Attesting large documents](/tutorials/attest_large_documents). ```shell diff --git a/tutorials/attest_custom.md b/tutorials/attest_custom.md index 9c678658..984542da 100644 --- a/tutorials/attest_custom.md +++ b/tutorials/attest_custom.md @@ -44,6 +44,8 @@ Prepare a JSON file with the data you want to attest. Save it as `coverage.json` In every example below, this `coverage.json` is the value of `--attestation-data`. +`--attestation-data` also accepts a `.yaml` or `.yml` file, which the CLI converts to JSON before sending it. + ## 2. Report the attestation A custom attestation can be bound to either a **trail** or an **artifact**. Pick the option that matches what you want to attest about. From c28e323da2e4f35ccf0c04164cba86f8240e6080 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2026 07:14:52 +0000 Subject: [PATCH 2/2] docs: explain why version-like yaml values need quoting --- getting_started/attestations.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/getting_started/attestations.md b/getting_started/attestations.md index 1757af6a..46e69136 100644 --- a/getting_started/attestations.md +++ b/getting_started/attestations.md @@ -210,8 +210,9 @@ attestation type's jq expression evaluates. This is what determines the complian attestation. See the [Custom](#custom) attestation type below for details. The file can be JSON or YAML. The CLI picks the format from the file extension: it converts a -`.yaml` or `.yml` file to JSON before sending it, and reads any other file as JSON. In YAML, a number -with a leading zero is read as octal, so quote version-like values and codes (`"1.10"`, `"0123"`) +`.yaml` or `.yml` file to JSON before sending it, and reads any other file as JSON. YAML reads an +unquoted number with a leading zero as octal (`0644` becomes `420`) and drops trailing zeros from +decimals (`1.10` becomes `1.1`), so quote version-like values and codes (`"1.10"`, `"0123"`) to keep them as written. A YAML file with several documents needs `--attestation-data-as-list`, which sends the documents as a JSON list. See [`kosli attest custom`](/client_reference/kosli_attest_custom) for the full conversion rules.