diff --git a/.github/workflows/validate-json.yaml b/.github/workflows/validate-json.yaml index 789d87a..b53a482 100644 --- a/.github/workflows/validate-json.yaml +++ b/.github/workflows/validate-json.yaml @@ -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" \ No newline at end of file + jsonschema validate softbinding-algorithm-list.schema.json softbinding-algorithm-list.json + echo "✓ softbinding-algorithm-list.json is valid against the schema" diff --git a/softbinding-algorithm-entry-schema.json b/softbinding-algorithm-list.schema.json similarity index 75% rename from softbinding-algorithm-entry-schema.json rename to softbinding-algorithm-list.schema.json index 12bbbc6..021f227 100644 --- a/softbinding-algorithm-entry-schema.json +++ b/softbinding-algorithm-list.schema.json @@ -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": { @@ -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", @@ -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" ] } -} \ No newline at end of file +}