|
32 | 32 | "type": "string", |
33 | 33 | "pattern": "^sha-256:[a-f0-9]{64}$" |
34 | 34 | }, |
35 | | - "recordDigest": { |
| 35 | + "contractDigest": { |
36 | 36 | "type": "string", |
37 | 37 | "pattern": "^sha-256:[a-f0-9]{64}$" |
38 | 38 | }, |
|
46 | 46 | "pattern": "^[0-9]+\\.[0-9]+(?:\\.[0-9]+)?(?:-[a-zA-Z0-9.-]+)?$", |
47 | 47 | "maxLength": 80 |
48 | 48 | }, |
49 | | - "recordDigest": { "$ref": "#/$defs/recordDigest" } |
| 49 | + "contractDigest": { "$ref": "#/$defs/contractDigest" } |
50 | 50 | }, |
51 | | - "required": ["id", "version", "recordDigest"] |
| 51 | + "required": ["id", "version", "contractDigest"] |
52 | 52 | }, |
53 | 53 | "target": { |
54 | 54 | "type": "object", |
|
172 | 172 | "profile": { "$ref": "#/$defs/profile" }, |
173 | 173 | "requestId": { "$ref": "#/$defs/uuidUrn" }, |
174 | 174 | "interactionId": { "$ref": "#/$defs/uuidUrn" }, |
175 | | - "requestedAt": { "type": "string", "format": "date-time" }, |
176 | 175 | "type": { "$ref": "#/$defs/typeReference" }, |
177 | 176 | "operation": { |
178 | 177 | "type": "string", |
|
187 | 186 | "profile", |
188 | 187 | "requestId", |
189 | 188 | "interactionId", |
190 | | - "requestedAt", |
191 | 189 | "type", |
192 | 190 | "operation", |
193 | 191 | "target", |
|
273 | 271 | }, |
274 | 272 | "target": { "$ref": "#/$defs/target" } |
275 | 273 | }, |
276 | | - "required": [ |
277 | | - "type", |
278 | | - "title", |
279 | | - "status", |
280 | | - "detail", |
281 | | - "instance", |
282 | | - "profile", |
283 | | - "requestId", |
284 | | - "interactionId", |
285 | | - "code" |
286 | | - ], |
| 274 | + "required": ["type", "title", "status", "detail"], |
| 275 | + "dependentRequired": { |
| 276 | + "instance": ["profile", "requestId", "code"], |
| 277 | + "profile": ["instance", "requestId", "code"], |
| 278 | + "requestId": ["instance", "profile", "code"], |
| 279 | + "interactionId": ["instance", "profile", "requestId", "code"], |
| 280 | + "code": ["instance", "profile", "requestId"] |
| 281 | + }, |
287 | 282 | "allOf": [ |
| 283 | + { |
| 284 | + "if": { |
| 285 | + "properties": { "code": { "not": { "const": "result-not-found" } } }, |
| 286 | + "required": ["code"] |
| 287 | + }, |
| 288 | + "then": { "required": ["interactionId"] } |
| 289 | + }, |
288 | 290 | { |
289 | 291 | "if": { "properties": { "code": { "const": "invalid-request" } }, "required": ["code"] }, |
290 | | - "then": { "properties": { "type": { "const": "https://mailschema.org/problems/invalid-request" }, "status": { "const": 400 } } } |
| 292 | + "then": { |
| 293 | + "properties": { |
| 294 | + "type": { "const": "https://mailschema.org/problems/invalid-request" }, |
| 295 | + "status": { "const": 400 } |
| 296 | + } |
| 297 | + } |
291 | 298 | }, |
292 | 299 | { |
293 | | - "if": { "properties": { "code": { "const": "authentication-required" } }, "required": ["code"] }, |
294 | | - "then": { "properties": { "type": { "const": "https://mailschema.org/problems/authentication-required" }, "status": { "const": 401 } } } |
| 300 | + "if": { |
| 301 | + "properties": { "code": { "const": "authentication-required" } }, |
| 302 | + "required": ["code"] |
| 303 | + }, |
| 304 | + "then": { |
| 305 | + "properties": { |
| 306 | + "type": { "const": "https://mailschema.org/problems/authentication-required" }, |
| 307 | + "status": { "const": 401 } |
| 308 | + } |
| 309 | + } |
295 | 310 | }, |
296 | 311 | { |
297 | 312 | "if": { "properties": { "code": { "const": "refused" } }, "required": ["code"] }, |
298 | | - "then": { "properties": { "type": { "const": "https://mailschema.org/problems/refused" }, "status": { "const": 403 } } } |
| 313 | + "then": { |
| 314 | + "properties": { |
| 315 | + "type": { "const": "https://mailschema.org/problems/refused" }, |
| 316 | + "status": { "const": 403 } |
| 317 | + } |
| 318 | + } |
299 | 319 | }, |
300 | 320 | { |
301 | 321 | "if": { "properties": { "code": { "const": "result-not-found" } }, "required": ["code"] }, |
302 | | - "then": { "properties": { "type": { "const": "https://mailschema.org/problems/result-not-found" }, "status": { "const": 404 } } } |
| 322 | + "then": { |
| 323 | + "properties": { |
| 324 | + "type": { "const": "https://mailschema.org/problems/result-not-found" }, |
| 325 | + "status": { "const": 404 } |
| 326 | + } |
| 327 | + } |
303 | 328 | }, |
304 | 329 | { |
305 | 330 | "if": { "properties": { "code": { "const": "stale-target" } }, "required": ["code"] }, |
306 | | - "then": { "properties": { "type": { "const": "https://mailschema.org/problems/stale-target" }, "status": { "const": 409 } }, "required": ["target"] } |
| 331 | + "then": { |
| 332 | + "properties": { |
| 333 | + "type": { "const": "https://mailschema.org/problems/stale-target" }, |
| 334 | + "status": { "const": 409 } |
| 335 | + }, |
| 336 | + "required": ["target"] |
| 337 | + } |
307 | 338 | }, |
308 | 339 | { |
309 | | - "if": { "properties": { "code": { "const": "idempotency-conflict" } }, "required": ["code"] }, |
310 | | - "then": { "properties": { "type": { "const": "https://mailschema.org/problems/idempotency-conflict" }, "status": { "const": 409 } } } |
| 340 | + "if": { |
| 341 | + "properties": { "code": { "const": "idempotency-conflict" } }, |
| 342 | + "required": ["code"] |
| 343 | + }, |
| 344 | + "then": { |
| 345 | + "properties": { |
| 346 | + "type": { "const": "https://mailschema.org/problems/idempotency-conflict" }, |
| 347 | + "status": { "const": 409 } |
| 348 | + } |
| 349 | + } |
311 | 350 | }, |
312 | 351 | { |
313 | | - "if": { "properties": { "code": { "const": "request-in-progress" } }, "required": ["code"] }, |
314 | | - "then": { "properties": { "type": { "const": "https://mailschema.org/problems/request-in-progress" }, "status": { "const": 409 } } } |
| 352 | + "if": { |
| 353 | + "properties": { "code": { "const": "request-in-progress" } }, |
| 354 | + "required": ["code"] |
| 355 | + }, |
| 356 | + "then": { |
| 357 | + "properties": { |
| 358 | + "type": { "const": "https://mailschema.org/problems/request-in-progress" }, |
| 359 | + "status": { "const": 409 } |
| 360 | + } |
| 361 | + } |
315 | 362 | }, |
316 | 363 | { |
317 | | - "if": { "properties": { "code": { "const": "expired-interaction" } }, "required": ["code"] }, |
318 | | - "then": { "properties": { "type": { "const": "https://mailschema.org/problems/expired-interaction" }, "status": { "const": 410 } } } |
| 364 | + "if": { |
| 365 | + "properties": { "code": { "const": "expired-interaction" } }, |
| 366 | + "required": ["code"] |
| 367 | + }, |
| 368 | + "then": { |
| 369 | + "properties": { |
| 370 | + "type": { "const": "https://mailschema.org/problems/expired-interaction" }, |
| 371 | + "status": { "const": 410 } |
| 372 | + } |
| 373 | + } |
319 | 374 | }, |
320 | 375 | { |
321 | | - "if": { "properties": { "code": { "const": "unsupported-profile" } }, "required": ["code"] }, |
322 | | - "then": { "properties": { "type": { "const": "https://mailschema.org/problems/unsupported-profile" }, "status": { "const": 422 } } } |
| 376 | + "if": { |
| 377 | + "properties": { "code": { "const": "unsupported-profile" } }, |
| 378 | + "required": ["code"] |
| 379 | + }, |
| 380 | + "then": { |
| 381 | + "properties": { |
| 382 | + "type": { "const": "https://mailschema.org/problems/unsupported-profile" }, |
| 383 | + "status": { "const": 422 } |
| 384 | + } |
| 385 | + } |
323 | 386 | }, |
324 | 387 | { |
325 | 388 | "if": { "properties": { "code": { "const": "unsupported-type" } }, "required": ["code"] }, |
326 | | - "then": { "properties": { "type": { "const": "https://mailschema.org/problems/unsupported-type" }, "status": { "const": 422 } } } |
| 389 | + "then": { |
| 390 | + "properties": { |
| 391 | + "type": { "const": "https://mailschema.org/problems/unsupported-type" }, |
| 392 | + "status": { "const": 422 } |
| 393 | + } |
| 394 | + } |
327 | 395 | }, |
328 | 396 | { |
329 | | - "if": { "properties": { "code": { "const": "unsupported-operation" } }, "required": ["code"] }, |
330 | | - "then": { "properties": { "type": { "const": "https://mailschema.org/problems/unsupported-operation" }, "status": { "const": 422 } } } |
| 397 | + "if": { |
| 398 | + "properties": { "code": { "const": "unsupported-operation" } }, |
| 399 | + "required": ["code"] |
| 400 | + }, |
| 401 | + "then": { |
| 402 | + "properties": { |
| 403 | + "type": { "const": "https://mailschema.org/problems/unsupported-operation" }, |
| 404 | + "status": { "const": 422 } |
| 405 | + } |
| 406 | + } |
331 | 407 | } |
332 | 408 | ] |
333 | 409 | } |
|
0 commit comments