Skip to content

Commit f9e7a17

Browse files
committed
Updates to validation
1 parent 5072faa commit f9e7a17

File tree

1 file changed

+11
-38
lines changed

1 file changed

+11
-38
lines changed

docs/manifest/reading/validation.md

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,33 @@ In the latest version of the SDK,
1313
Need a high-level summary of full validation, what we're looking for, etc.
1414
</div>
1515

16-
## Validation errors in manifests
17-
18-
When you load an asset, all the manifests in the manifest store are validated and any [failure codes](https://c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_failure_codes) are assigned to the `validation_status` array. Inspect the array to find the validation errors.
19-
2016
`Reader` has these validation methods:
21-
- `validation_state()` returns `ValidationState`, which can be `Invalid`, `Valid` or `Trusted`.
22-
- `validation_results()` returns `ValidationResults`, which returns `success`, `informational`, and `failure` codes for the active manifest and ingredients. NOTE: `ValidationStatus` is deprecated in favor of `ValidationResults`.
17+
- `validation_state()` returns `ValidationState` object (`validation_state` in JSON), which can be `Invalid`, `Valid` or `Trusted`.
18+
- `validation_results()` returns `ValidationResults` (`validation_results` in JSON), which can be `success`, `informational`, and `failure` codes for the active manifest and ingredients.
2319

24-
:::tip
25-
Validation returns ONLY error codes; success is not explicitly indicated. If there are no validation errors, then the manifest won't have the `validation_status` element.
20+
:::note
21+
The old `ValidationStatus` and `validation_status` array in previous SDK releases are deprecated in favor of `ValidationResults` / `validation_results` and `ValidationState` / `validation_state`.
2622
:::
2723

24+
## Validation errors in manifests
25+
26+
When you load an asset, all the manifests in the manifest store are validated and [result codes](https://c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_failure_codes) are assigned to properties in the `validation_results` object.
27+
2828
Manifest validation errors can occur, for example, when:
2929

3030
- The bits of an asset are edited after it was signed.
3131
- A claim or assertion is missing or tampered with.
3232
- The manifest is signed with an invalid credential.
3333

34-
:::caution
35-
Don't assume that just because you didn't get an error from the function return value that there are not validation errors. You MUST check the `validation_status` array to see if there are errors or not.
36-
:::
37-
3834
## Validation errors in ingredients
3935

40-
Ingredients are validated when they are imported into an asset and the result is stored in the ingredient's `validation_status` array.
36+
Ingredients are validated when they are imported into an asset and the result is stored in the ingredient's `validation_results` object.
4137

42-
Only errors that are not already recorded in the `validation_status` of an ingredient are reported. See [ValidationStatus](../json-ref/manifest-def.mdx#validationstatus) object in Manifest store reference.
38+
Only errors that are not already recorded in the `validation_results` of an ingredient are reported. See [ValidationStatus](../json-ref/manifest-def.mdx#validationresults) object in Manifest store reference.
4339

4440
## Error status codes
4541

46-
The following table describes some common validation error status codes. Refer to the [C2PA Technical Specification](https://c2pa.org/specifications/specification2.2/specs/C2PA_Specification.html#_failure_codes) for the full list.
42+
The following table describes some common validation error status codes. Refer to the [C2PA Technical Specification](https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_failure_codes) for the full list.
4743

4844
| Validation Status Code| Description | Type of URI |
4945
| --------------------- | ------------ | ----------- |
@@ -64,26 +60,3 @@ Validation error status codes can contain JUMBF URIs that reference assertions o
6460
- **Signature Box URI**: A URI like `self#jumbf=c2pa.signature`.
6561

6662
For more information, see the [C2PA Technical Specification](https://c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_uri_references).
67-
68-
<!--
69-
Actions and assertions:
70-
71-
For actions - reference the spec e.g. common actions we refer to
72-
73-
How to describe an EXIF assertion in JSON
74-
75-
CreativeWork assertion
76-
77-
Actions
78-
- Examples
79-
- Ref to spec and schema.org
80-
- GenAI - variation of Created Action
81-
82-
Assertions
83-
84-
- CreativeWork assertion
85-
- DNT - Special assertion
86-
- EXIF
87-
88-
User-defined assertion
89-
-->

0 commit comments

Comments
 (0)