Skip to content

Commit 2480f46

Browse files
committed
Modified schema to describe an array of objects, not just a single object.
1 parent 3e0528c commit 2480f46

File tree

1 file changed

+104
-98
lines changed

1 file changed

+104
-98
lines changed
Lines changed: 104 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,114 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"type": "object",
4-
"properties": {
5-
"identifier": {
6-
"type": "integer",
7-
"minimum": 0,
8-
"maximum": 65535,
9-
"description": "This identifier will be assigned when the soft binding algorithm is added to the list."
10-
},
11-
"deprecated": {
12-
"type": "boolean",
13-
"default": false,
14-
"description": "Indicates whether this soft binding algorithm is deprecated. Deprecated algorithms shall not be used for creating soft bindings. Deprecated algorithms may be used for resolving soft bindings but this behaviour is discouraged."
15-
},
16-
"alg": {
17-
"type": "string",
18-
"pattern": "(c2pa\\.|[A-Za-z0-9\\-\\.]+)",
19-
"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`)"
20-
},
21-
"type": {
22-
"enum": [
23-
"watermark",
24-
"fingerprint"
25-
],
26-
"description": "Type of soft binding implemented by this algorithm."
27-
},
28-
"decodedMediaTypes": {
29-
"type": "array",
30-
"minItems": 1,
31-
"items": {
3+
"$id": "https://c2pa.org/schemas/softbinding-algorithm-list.json",
4+
"type": "array",
5+
"items": {
6+
"type": "object",
7+
"properties": {
8+
"identifier": {
9+
"type": "integer",
10+
"minimum": 0,
11+
"maximum": 65535,
12+
"description": "This identifier will be assigned when the soft binding algorithm is added to the list."
13+
},
14+
"deprecated": {
15+
"type": "boolean",
16+
"default": false,
17+
"description": "Indicates whether this soft binding algorithm is deprecated. Deprecated algorithms shall not be used for creating soft bindings. Deprecated algorithms may be used for resolving soft bindings but this behaviour is discouraged."
18+
},
19+
"alg": {
20+
"type": "string",
21+
"pattern": "(c2pa\\.|[A-Za-z0-9\\-\\.]+)",
22+
"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`)"
23+
},
24+
"type": {
3225
"enum": [
33-
"application",
34-
"audio",
35-
"image",
36-
"model",
37-
"text",
38-
"video"
26+
"watermark",
27+
"fingerprint"
3928
],
40-
"description": "IANA top level media type (rendered) for which this soft binding algorithm applies."
41-
}
42-
},
43-
"encodedMediaTypes": {
44-
"type": "array",
45-
"minItems": 1,
46-
"items": {
47-
"type": "string",
48-
"description": "IANA media type for which this soft binding algorithm applies, e.g., application/pdf",
49-
"pattern": "^([a-zA-Z0-9\\-]+\\/[a-zA-Z0-9\\-\\+]+(?:\\.[a-zA-Z0-9\\-\\+]+)*)$"
50-
}
51-
},
52-
"entryMetadata": {
53-
"type": "object",
54-
"properties": {
55-
"description": {
56-
"type": "string",
57-
"description": "Human readable description of the algorithm."
58-
},
59-
"dateEntered": {
29+
"description": "Type of soft binding implemented by this algorithm."
30+
},
31+
"decodedMediaTypes": {
32+
"type": "array",
33+
"minItems": 1,
34+
"items": {
35+
"enum": [
36+
"application",
37+
"audio",
38+
"image",
39+
"model",
40+
"text",
41+
"video"
42+
],
43+
"description": "IANA top level media type (rendered) for which this soft binding algorithm applies."
44+
}
45+
},
46+
"encodedMediaTypes": {
47+
"type": "array",
48+
"minItems": 1,
49+
"items": {
6050
"type": "string",
61-
"format": "date-time",
62-
"description": "Date of entry for this algorithm."
51+
"description": "IANA media type for which this soft binding algorithm applies, e.g., application/pdf",
52+
"pattern": "^([a-zA-Z0-9\\-]+\\/[a-zA-Z0-9\\-\\+]+(?:\\.[a-zA-Z0-9\\-\\+]+)*)$"
53+
}
54+
},
55+
"entryMetadata": {
56+
"type": "object",
57+
"properties": {
58+
"description": {
59+
"type": "string",
60+
"description": "Human readable description of the algorithm."
61+
},
62+
"dateEntered": {
63+
"type": "string",
64+
"format": "date-time",
65+
"description": "Date of entry for this algorithm."
66+
},
67+
"contact": {
68+
"type": "string",
69+
"format": "email"
70+
},
71+
"informationalUrl": {
72+
"type": "string",
73+
"format": "uri",
74+
"description": "A web page containing more details about the algorithm."
75+
}
6376
},
64-
"contact": {
77+
"required": [
78+
"description",
79+
"dateEntered",
80+
"contact",
81+
"informationalUrl"
82+
]
83+
},
84+
"softBindingResolutionApis": {
85+
"type": "array",
86+
"items": {
6587
"type": "string",
66-
"format": "email"
88+
"format": "uri"
6789
},
68-
"informationalUrl": {
69-
"type": "string",
70-
"format": "uri",
71-
"description": "A web page containing more details about the algorithm."
72-
}
73-
},
74-
"required": [
75-
"description",
76-
"dateEntered",
77-
"contact",
78-
"informationalUrl"
79-
]
90+
"description": "A list of Soft Binding Resolution APIs supporting this algorithm."
91+
}
8092
},
81-
"softBindingResolutionApis": {
82-
"type": "array",
83-
"items": {
84-
"type": "string",
85-
"format": "uri"
93+
"oneOf": [
94+
{
95+
"required": ["decodedMediaTypes"],
96+
"not": {
97+
"required": ["encodedMediaTypes"]
98+
}
8699
},
87-
"description": "A list of Soft Binding Resolution APIs supporting this algorithm."
88-
}
89-
},
90-
"required": [
91-
"identifier",
92-
"alg",
93-
"type",
94-
"entryMetadata"
95-
],
96-
"oneOf": [
97-
{
98-
"required": [
99-
"decodedMediaTypes"
100-
]
101-
},
102-
{
103-
"required": [
104-
"encodedMediaTypes"
105-
]
106-
}
107-
]
108-
}
100+
{
101+
"required": ["encodedMediaTypes"],
102+
"not": {
103+
"required": ["decodedMediaTypes"]
104+
}
105+
}
106+
],
107+
"required": [
108+
"identifier",
109+
"alg",
110+
"type",
111+
"entryMetadata"
112+
]
113+
}
114+
}

0 commit comments

Comments
 (0)