Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/validate-json.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:

- name: Lint JSON files
run: |
echo "Linting softbinding-algorithm-entry-schema.json..."
echo "Linting softbinding-algorithm-list.schema.json..."
set -e # Exit on any error
jsonschema lint softbinding-algorithm-entry-schema.json
echo "✓ softbinding-algorithm-entry-schema.json passed linting"
jsonschema lint softbinding-algorithm-list.schema.json
echo "✓ softbinding-algorithm-list.schema.json passed linting"

- name: Validate against schema
run: |
echo "Validating softbinding-algorithm-list.json against schema..."
set -e # Exit on any error
jsonschema validate softbinding-algorithm-entry-schema.json softbinding-algorithm-list.json
echo "✓ softbinding-algorithm-list.json is valid against the schema"
jsonschema validate softbinding-algorithm-list.schema.json softbinding-algorithm-list.json
echo "✓ softbinding-algorithm-list.json is valid against the schema"
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"alg": {
"type": "string",
"pattern": "(c2pa\\.|[A-Za-z0-9\\-\\.]+)",
"pattern": "^[A-Za-z]{2,63}(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)+\\.?$",
"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`)"
},
"type": {
Expand Down Expand Up @@ -59,6 +59,14 @@
"type": "string",
"description": "Human readable description of the algorithm."
},
"categories": {
"type": "array",
"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`)",
"items": {
"type": "string",
"pattern": "^[A-Za-z]{2,63}(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)+\\.?$"
}
},
"dateEntered": {
"type": "string",
"format": "date-time",
Expand Down Expand Up @@ -90,25 +98,33 @@
"description": "A list of Soft Binding Resolution APIs supporting this algorithm."
}
},
"required": [
"identifier",
"alg",
"type",
"entryMetadata"
],
"oneOf": [
{
"required": ["decodedMediaTypes"],
"required": [
"decodedMediaTypes"
],
"not": {
"required": ["encodedMediaTypes"]
"required": [
"encodedMediaTypes"
]
}
},
{
"required": ["encodedMediaTypes"],
"required": [
"encodedMediaTypes"
],
"not": {
"required": ["decodedMediaTypes"]
"required": [
"decodedMediaTypes"
]
}
}
],
"required": [
"identifier",
"alg",
"type",
"entryMetadata"
]
}
}
}