Skip to content

Commit c20768e

Browse files
authored
Merge pull request #33 from c2pa-org/align-schema
Aligning with CORE schema
2 parents d09dc37 + 38ee1e2 commit c20768e

File tree

2 files changed

+33
-17
lines changed

2 files changed

+33
-17
lines changed

.github/workflows/validate-json.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ jobs:
1919

2020
- name: Lint JSON files
2121
run: |
22-
echo "Linting softbinding-algorithm-entry-schema.json..."
22+
echo "Linting softbinding-algorithm-list.schema.json..."
2323
set -e # Exit on any error
24-
jsonschema lint softbinding-algorithm-entry-schema.json
25-
echo "✓ softbinding-algorithm-entry-schema.json passed linting"
24+
jsonschema lint softbinding-algorithm-list.schema.json
25+
echo "✓ softbinding-algorithm-list.schema.json passed linting"
2626
2727
- name: Validate against schema
2828
run: |
2929
echo "Validating softbinding-algorithm-list.json against schema..."
3030
set -e # Exit on any error
31-
jsonschema validate softbinding-algorithm-entry-schema.json softbinding-algorithm-list.json
32-
echo "✓ softbinding-algorithm-list.json is valid against the schema"
31+
jsonschema validate softbinding-algorithm-list.schema.json softbinding-algorithm-list.json
32+
echo "✓ softbinding-algorithm-list.json is valid against the schema"

softbinding-algorithm-entry-schema.json renamed to softbinding-algorithm-list.schema.json

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"alg": {
2020
"type": "string",
21-
"pattern": "(c2pa\\.|[A-Za-z0-9\\-\\.]+)",
21+
"pattern": "^[A-Za-z]{2,63}(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)+\\.?$",
2222
"description": "Entity-specific namespace as specified for C2PA Assertions labels that shall begin with the Internet domain name for the entity similar to how Java packages are defined (e.g., `com.example.algo1`, `net.example.algos.algo2`)"
2323
},
2424
"type": {
@@ -59,6 +59,14 @@
5959
"type": "string",
6060
"description": "Human readable description of the algorithm."
6161
},
62+
"categories": {
63+
"type": "array",
64+
"description": "This allows specifying values that can be used to cluster this algorithm with others of the same or similar values. For example an algorithm that is used in a certain context (e.g., verified news, advertising). The format of these categories follows the entity-specific namespace as specified for C2PA Assertions labels that shall begin with the (reversed) Internet domain name for the entity similar to how Java packages are defined (e.g., `org.iptc.watermarking`, `net.example.cluster.context1`)",
65+
"items": {
66+
"type": "string",
67+
"pattern": "^[A-Za-z]{2,63}(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)+\\.?$"
68+
}
69+
},
6270
"dateEntered": {
6371
"type": "string",
6472
"format": "date-time",
@@ -90,25 +98,33 @@
9098
"description": "A list of Soft Binding Resolution APIs supporting this algorithm."
9199
}
92100
},
101+
"required": [
102+
"identifier",
103+
"alg",
104+
"type",
105+
"entryMetadata"
106+
],
93107
"oneOf": [
94108
{
95-
"required": ["decodedMediaTypes"],
109+
"required": [
110+
"decodedMediaTypes"
111+
],
96112
"not": {
97-
"required": ["encodedMediaTypes"]
113+
"required": [
114+
"encodedMediaTypes"
115+
]
98116
}
99117
},
100118
{
101-
"required": ["encodedMediaTypes"],
119+
"required": [
120+
"encodedMediaTypes"
121+
],
102122
"not": {
103-
"required": ["decodedMediaTypes"]
123+
"required": [
124+
"decodedMediaTypes"
125+
]
104126
}
105127
}
106-
],
107-
"required": [
108-
"identifier",
109-
"alg",
110-
"type",
111-
"entryMetadata"
112128
]
113129
}
114-
}
130+
}

0 commit comments

Comments
 (0)