{
  "schema": "NET002_VISIBLE_CONTRACTS_v1",
  "profiles": {
    "GET_POST_R1": {
      "profile": "GET_POST_R1",
      "endpoints": [
        {
          "endpoint_id": "GetOrder",
          "http_method": "GET",
          "route_template": "/orders/{id:int}",
          "openapi_path": "/orders/{id}",
          "request_schema_ref": "NONE",
          "request_content_type": null,
          "response_schema_ref": "Order",
          "status_code_contract": [
            200,
            401,
            403,
            404,
            500
          ],
          "validation_rule": "INTEGER_ROUTE_CONSTRAINT",
          "authentication_state": "TEST_IDENTITY_ONLY",
          "authorization_policy": "Orders.Read",
          "problem_details_state": "SAFE_TYPED_ERRORS",
          "idempotency_expectation": "READ_ONLY",
          "dependency_boundary": "IN_MEMORY_STORE"
        },
        {
          "endpoint_id": "CreateOrder",
          "http_method": "POST",
          "route_template": "/orders",
          "openapi_path": "/orders",
          "request_schema_ref": "CreateOrder",
          "request_content_type": "application/json",
          "response_schema_ref": "Order",
          "status_code_contract": [
            201,
            400,
            401,
            403,
            409,
            415,
            422,
            500
          ],
          "validation_rule": "STRICT_SHAPE_THEN_DOMAIN_422",
          "authentication_state": "TEST_IDENTITY_ONLY",
          "authorization_policy": "Orders.Write",
          "problem_details_state": "SAFE_TYPED_ERRORS",
          "idempotency_expectation": "ACTOR_METHOD_ROUTE_KEY_PLUS_BODY",
          "dependency_boundary": "SYNTHETIC_STORE_BEFORE_COMMIT"
        }
      ],
      "schemas": {
        "CreateOrder": {
          "type": "object",
          "required": [
            "customerReference",
            "quantity"
          ],
          "additionalProperties": false,
          "properties": {
            "customerReference": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "quantity": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          }
        },
        "PatchOrder": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "quantity": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          }
        },
        "Order": {
          "type": "object",
          "required": [
            "id",
            "customerReference",
            "quantity"
          ],
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "integer"
            },
            "customerReference": {
              "type": "string"
            },
            "quantity": {
              "type": "integer"
            }
          }
        },
        "Problem": {
          "type": "object",
          "required": [
            "type",
            "title",
            "status",
            "instance",
            "traceId"
          ],
          "additionalProperties": false,
          "properties": {
            "type": {
              "type": "string",
              "format": "uri"
            },
            "title": {
              "type": "string"
            },
            "status": {
              "type": "integer"
            },
            "instance": {
              "type": "string",
              "format": "uri"
            },
            "traceId": {
              "type": "string"
            }
          }
        }
      },
      "required_case_ids": [
        "get_ok",
        "get_missing",
        "get_unauthenticated",
        "get_forbidden",
        "get_bad_id",
        "get_failure",
        "post_created",
        "post_invalid",
        "post_binding",
        "post_malformed",
        "post_unauthenticated",
        "post_forbidden",
        "post_replay",
        "post_key_conflict",
        "post_no_key",
        "post_failure",
        "post_wrong_media",
        "post_cross_actor",
        "post_concurrent"
      ],
      "implementation_controls": {
        "pipeline_order": [
          "EXCEPTION_HANDLER",
          "ROUTING",
          "AUTHENTICATION",
          "AUTHORIZATION",
          "BINDING",
          "VALIDATION",
          "HANDLER"
        ],
        "idempotency_mechanism": "PROCESS_LOCKED_MAP",
        "idempotency_retention": "PROCESS_LIFETIME_ONLY",
        "configuration_profile": "TEST_NO_REDIRECTS_JSON_ACCEPT",
        "dependency_timeout_ms": null,
        "patch_semantics": "NOT_IN_BASELINE",
        "dependency_timeout_policy": "NOT_IN_BASELINE"
      }
    },
    "GET_POST_PATCH_R2": {
      "profile": "GET_POST_PATCH_R2",
      "endpoints": [
        {
          "endpoint_id": "GetOrder",
          "http_method": "GET",
          "route_template": "/orders/{id:int}",
          "openapi_path": "/orders/{id}",
          "request_schema_ref": "NONE",
          "request_content_type": null,
          "response_schema_ref": "Order",
          "status_code_contract": [
            200,
            401,
            403,
            404,
            500
          ],
          "validation_rule": "INTEGER_ROUTE_CONSTRAINT",
          "authentication_state": "TEST_IDENTITY_ONLY",
          "authorization_policy": "Orders.Read",
          "problem_details_state": "SAFE_TYPED_ERRORS",
          "idempotency_expectation": "READ_ONLY",
          "dependency_boundary": "IN_MEMORY_STORE"
        },
        {
          "endpoint_id": "CreateOrder",
          "http_method": "POST",
          "route_template": "/orders",
          "openapi_path": "/orders",
          "request_schema_ref": "CreateOrder",
          "request_content_type": "application/json",
          "response_schema_ref": "Order",
          "status_code_contract": [
            201,
            400,
            401,
            403,
            409,
            415,
            422,
            500
          ],
          "validation_rule": "STRICT_SHAPE_THEN_DOMAIN_422",
          "authentication_state": "TEST_IDENTITY_ONLY",
          "authorization_policy": "Orders.Write",
          "problem_details_state": "SAFE_TYPED_ERRORS",
          "idempotency_expectation": "ACTOR_METHOD_ROUTE_KEY_PLUS_BODY",
          "dependency_boundary": "SYNTHETIC_STORE_BEFORE_COMMIT"
        },
        {
          "endpoint_id": "PatchOrder",
          "http_method": "PATCH",
          "route_template": "/orders/{id:int}",
          "openapi_path": "/orders/{id}",
          "request_schema_ref": "PatchOrder",
          "request_content_type": "application/vnd.maknow.order-patch+json",
          "response_schema_ref": "Order",
          "status_code_contract": [
            200,
            400,
            401,
            403,
            404,
            415,
            422,
            500,
            503
          ],
          "validation_rule": "OMIT_PRESERVES_NULL_REJECTED",
          "authentication_state": "TEST_IDENTITY_ONLY",
          "authorization_policy": "Orders.Write",
          "problem_details_state": "SAFE_TYPED_ERRORS",
          "idempotency_expectation": "ABSOLUTE_ASSIGNMENT_NO_REPLAY_PROMISE",
          "dependency_boundary": "READ_ONLY_BACKGROUND_AVAILABILITY_BEFORE_COMMIT"
        }
      ],
      "schemas": {
        "CreateOrder": {
          "type": "object",
          "required": [
            "customerReference",
            "quantity"
          ],
          "additionalProperties": false,
          "properties": {
            "customerReference": {
              "type": "string",
              "minLength": 1,
              "maxLength": 40
            },
            "quantity": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          }
        },
        "PatchOrder": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "quantity": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          }
        },
        "Order": {
          "type": "object",
          "required": [
            "id",
            "customerReference",
            "quantity"
          ],
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "integer"
            },
            "customerReference": {
              "type": "string"
            },
            "quantity": {
              "type": "integer"
            }
          }
        },
        "Problem": {
          "type": "object",
          "required": [
            "type",
            "title",
            "status",
            "instance",
            "traceId"
          ],
          "additionalProperties": false,
          "properties": {
            "type": {
              "type": "string",
              "format": "uri"
            },
            "title": {
              "type": "string"
            },
            "status": {
              "type": "integer"
            },
            "instance": {
              "type": "string",
              "format": "uri"
            },
            "traceId": {
              "type": "string"
            }
          }
        }
      },
      "required_case_ids": [
        "get_ok",
        "get_missing",
        "get_unauthenticated",
        "get_forbidden",
        "get_bad_id",
        "get_failure",
        "post_created",
        "post_invalid",
        "post_binding",
        "post_malformed",
        "post_unauthenticated",
        "post_forbidden",
        "post_replay",
        "post_key_conflict",
        "post_no_key",
        "post_failure",
        "post_wrong_media",
        "post_cross_actor",
        "post_concurrent",
        "patch_set",
        "patch_omit",
        "patch_null",
        "patch_timeout",
        "patch_missing",
        "patch_unauthenticated",
        "patch_forbidden",
        "patch_invalid",
        "patch_wrong_media",
        "patch_binding",
        "patch_failure",
        "patch_same"
      ],
      "implementation_controls": {
        "pipeline_order": [
          "EXCEPTION_HANDLER",
          "ROUTING",
          "AUTHENTICATION",
          "AUTHORIZATION",
          "BINDING",
          "VALIDATION",
          "HANDLER"
        ],
        "idempotency_mechanism": "PROCESS_LOCKED_MAP",
        "idempotency_retention": "PROCESS_LIFETIME_ONLY",
        "configuration_profile": "TEST_NO_REDIRECTS_JSON_ACCEPT",
        "dependency_timeout_ms": 100,
        "patch_semantics": "OMIT_PRESERVES_NULL_REJECTED",
        "dependency_timeout_policy": "503_NO_LOCAL_WRITE_READ_ONLY_PROBE"
      }
    }
  },
  "case_specs": {
    "get_ok": {
      "case_id": "get_ok",
      "requests": [
        {
          "request_id": "get_ok",
          "method": "GET",
          "path": "/orders/1",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          200
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 200,
            "content_type": "application/json",
            "headers": {},
            "body": {
              "id": 1,
              "customerReference": "seed-01",
              "quantity": 2
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "get_missing": {
      "case_id": "get_missing",
      "requests": [
        {
          "request_id": "get_missing",
          "method": "GET",
          "path": "/orders/99",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          404
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 404,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:not-found",
              "title": "Order not found",
              "status": 404,
              "instance": "urn:maknow:request:get_missing",
              "traceId": "trace-get_missing"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "get_unauthenticated": {
      "case_id": "get_unauthenticated",
      "requests": [
        {
          "request_id": "get_unauthenticated",
          "method": "GET",
          "path": "/orders/1",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": false,
            "subject": null,
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          401
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 401,
            "content_type": "application/problem+json",
            "headers": {
              "WWW-Authenticate": "Bearer"
            },
            "body": {
              "type": "urn:maknow:problem:unauthenticated",
              "title": "Authentication required",
              "status": 401,
              "instance": "urn:maknow:request:get_unauthenticated",
              "traceId": "trace-get_unauthenticated"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION"
            ]
          }
        ]
      }
    },
    "get_forbidden": {
      "case_id": "get_forbidden",
      "requests": [
        {
          "request_id": "get_forbidden",
          "method": "GET",
          "path": "/orders/1",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": []
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          403
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 403,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:forbidden",
              "title": "Access denied",
              "status": 403,
              "instance": "urn:maknow:request:get_forbidden",
              "traceId": "trace-get_forbidden"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION"
            ]
          }
        ]
      }
    },
    "get_bad_id": {
      "case_id": "get_bad_id",
      "requests": [
        {
          "request_id": "get_bad_id",
          "method": "GET",
          "path": "/orders/nope",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          404
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 404,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:not-found",
              "title": "Order not found",
              "status": 404,
              "instance": "urn:maknow:request:get_bad_id",
              "traceId": "trace-get_bad_id"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING"
            ]
          }
        ]
      }
    },
    "get_failure": {
      "case_id": "get_failure",
      "requests": [
        {
          "request_id": "get_failure",
          "method": "GET",
          "path": "/orders/1",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "FAIL"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          500
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 500,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:unexpected",
              "title": "Unexpected failure",
              "status": 500,
              "instance": "urn:maknow:request:get_failure",
              "traceId": "trace-get_failure"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "post_created": {
      "case_id": "post_created",
      "requests": [
        {
          "request_id": "post_created",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          201
        ],
        "writes": 1,
        "dependency_calls": 1,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          },
          {
            "id": 2,
            "customerReference": "r-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 201,
            "content_type": "application/json",
            "headers": {
              "Location": "/orders/2"
            },
            "body": {
              "id": 2,
              "customerReference": "r-01",
              "quantity": 2
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "post_invalid": {
      "case_id": "post_invalid",
      "requests": [
        {
          "request_id": "post_invalid",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":0}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          422
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 422,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:validation",
              "title": "Order validation failed",
              "status": 422,
              "instance": "urn:maknow:request:post_invalid",
              "traceId": "trace-post_invalid"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION"
            ]
          }
        ]
      }
    },
    "post_binding": {
      "case_id": "post_binding",
      "requests": [
        {
          "request_id": "post_binding",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":\"2\"}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          400
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 400,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:invalid-request",
              "title": "Invalid request",
              "status": 400,
              "instance": "urn:maknow:request:post_binding",
              "traceId": "trace-post_binding"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING"
            ]
          }
        ]
      }
    },
    "post_malformed": {
      "case_id": "post_malformed",
      "requests": [
        {
          "request_id": "post_malformed",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          400
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 400,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:invalid-request",
              "title": "Invalid request",
              "status": 400,
              "instance": "urn:maknow:request:post_malformed",
              "traceId": "trace-post_malformed"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING"
            ]
          }
        ]
      }
    },
    "post_unauthenticated": {
      "case_id": "post_unauthenticated",
      "requests": [
        {
          "request_id": "post_unauthenticated",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": false,
            "subject": null,
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          401
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 401,
            "content_type": "application/problem+json",
            "headers": {
              "WWW-Authenticate": "Bearer"
            },
            "body": {
              "type": "urn:maknow:problem:unauthenticated",
              "title": "Authentication required",
              "status": 401,
              "instance": "urn:maknow:request:post_unauthenticated",
              "traceId": "trace-post_unauthenticated"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION"
            ]
          }
        ]
      }
    },
    "post_forbidden": {
      "case_id": "post_forbidden",
      "requests": [
        {
          "request_id": "post_forbidden",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          403
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 403,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:forbidden",
              "title": "Access denied",
              "status": 403,
              "instance": "urn:maknow:request:post_forbidden",
              "traceId": "trace-post_forbidden"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION"
            ]
          }
        ]
      }
    },
    "post_replay": {
      "case_id": "post_replay",
      "requests": [
        {
          "request_id": "post_replay-1",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        },
        {
          "request_id": "post_replay-2",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          201,
          201
        ],
        "writes": 1,
        "dependency_calls": 1,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          },
          {
            "id": 2,
            "customerReference": "r-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 201,
            "content_type": "application/json",
            "headers": {
              "Location": "/orders/2"
            },
            "body": {
              "id": 2,
              "customerReference": "r-01",
              "quantity": 2
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          },
          {
            "status": 201,
            "content_type": "application/json",
            "headers": {
              "Location": "/orders/2"
            },
            "body": {
              "id": 2,
              "customerReference": "r-01",
              "quantity": 2
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "post_key_conflict": {
      "case_id": "post_key_conflict",
      "requests": [
        {
          "request_id": "post_key_conflict-1",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        },
        {
          "request_id": "post_key_conflict-2",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":3}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          201,
          409
        ],
        "writes": 1,
        "dependency_calls": 1,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          },
          {
            "id": 2,
            "customerReference": "r-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 201,
            "content_type": "application/json",
            "headers": {
              "Location": "/orders/2"
            },
            "body": {
              "id": 2,
              "customerReference": "r-01",
              "quantity": 2
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          },
          {
            "status": 409,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:idempotency-conflict",
              "title": "Idempotency key conflict",
              "status": 409,
              "instance": "urn:maknow:request:post_key_conflict-2",
              "traceId": "trace-post_key_conflict-2"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "post_no_key": {
      "case_id": "post_no_key",
      "requests": [
        {
          "request_id": "post_no_key",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": null,
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          400
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 400,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:invalid-request",
              "title": "Invalid request",
              "status": 400,
              "instance": "urn:maknow:request:post_no_key",
              "traceId": "trace-post_no_key"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING"
            ]
          }
        ]
      }
    },
    "post_failure": {
      "case_id": "post_failure",
      "requests": [
        {
          "request_id": "post_failure",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "FAIL"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          500
        ],
        "writes": 0,
        "dependency_calls": 1,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 500,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:unexpected",
              "title": "Unexpected failure",
              "status": 500,
              "instance": "urn:maknow:request:post_failure",
              "traceId": "trace-post_failure"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "post_wrong_media": {
      "case_id": "post_wrong_media",
      "requests": [
        {
          "request_id": "post_wrong_media",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "text/plain",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          415
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 415,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:unsupported-media",
              "title": "Unsupported media type",
              "status": 415,
              "instance": "urn:maknow:request:post_wrong_media",
              "traceId": "trace-post_wrong_media"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING"
            ]
          }
        ]
      }
    },
    "post_cross_actor": {
      "case_id": "post_cross_actor",
      "requests": [
        {
          "request_id": "post_cross_actor-1",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        },
        {
          "request_id": "post_cross_actor-2",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-b",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          201,
          201
        ],
        "writes": 2,
        "dependency_calls": 2,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          },
          {
            "id": 2,
            "customerReference": "r-01",
            "quantity": 2
          },
          {
            "id": 3,
            "customerReference": "r-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 201,
            "content_type": "application/json",
            "headers": {
              "Location": "/orders/2"
            },
            "body": {
              "id": 2,
              "customerReference": "r-01",
              "quantity": 2
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          },
          {
            "status": 201,
            "content_type": "application/json",
            "headers": {
              "Location": "/orders/3"
            },
            "body": {
              "id": 3,
              "customerReference": "r-01",
              "quantity": 2
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "post_concurrent": {
      "case_id": "post_concurrent",
      "requests": [
        {
          "request_id": "post_concurrent-1",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        },
        {
          "request_id": "post_concurrent-2",
          "method": "POST",
          "path": "/orders",
          "raw_body": "{\"customerReference\":\"r-01\",\"quantity\":2}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": true,
      "expected": {
        "statuses": [
          201,
          201
        ],
        "writes": 1,
        "dependency_calls": 1,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          },
          {
            "id": 2,
            "customerReference": "r-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 201,
            "content_type": "application/json",
            "headers": {
              "Location": "/orders/2"
            },
            "body": {
              "id": 2,
              "customerReference": "r-01",
              "quantity": 2
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          },
          {
            "status": 201,
            "content_type": "application/json",
            "headers": {
              "Location": "/orders/2"
            },
            "body": {
              "id": 2,
              "customerReference": "r-01",
              "quantity": 2
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "patch_set": {
      "case_id": "patch_set",
      "requests": [
        {
          "request_id": "patch_set",
          "method": "PATCH",
          "path": "/orders/1",
          "raw_body": "{\"quantity\":3}",
          "content_type": "application/vnd.maknow.order-patch+json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          200
        ],
        "writes": 1,
        "dependency_calls": 1,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 3
          }
        ],
        "responses": [
          {
            "status": 200,
            "content_type": "application/json",
            "headers": {},
            "body": {
              "id": 1,
              "customerReference": "seed-01",
              "quantity": 3
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "patch_omit": {
      "case_id": "patch_omit",
      "requests": [
        {
          "request_id": "patch_omit",
          "method": "PATCH",
          "path": "/orders/1",
          "raw_body": "{}",
          "content_type": "application/vnd.maknow.order-patch+json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          200
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 200,
            "content_type": "application/json",
            "headers": {},
            "body": {
              "id": 1,
              "customerReference": "seed-01",
              "quantity": 2
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "patch_null": {
      "case_id": "patch_null",
      "requests": [
        {
          "request_id": "patch_null",
          "method": "PATCH",
          "path": "/orders/1",
          "raw_body": "{\"quantity\":null}",
          "content_type": "application/vnd.maknow.order-patch+json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          422
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 422,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:validation",
              "title": "Order validation failed",
              "status": 422,
              "instance": "urn:maknow:request:patch_null",
              "traceId": "trace-patch_null"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION"
            ]
          }
        ]
      }
    },
    "patch_timeout": {
      "case_id": "patch_timeout",
      "requests": [
        {
          "request_id": "patch_timeout",
          "method": "PATCH",
          "path": "/orders/1",
          "raw_body": "{\"quantity\":3}",
          "content_type": "application/vnd.maknow.order-patch+json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "TIMEOUT"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          503
        ],
        "writes": 0,
        "dependency_calls": 1,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 503,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:availability-unavailable",
              "title": "Availability unavailable",
              "status": 503,
              "instance": "urn:maknow:request:patch_timeout",
              "traceId": "trace-patch_timeout"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "patch_missing": {
      "case_id": "patch_missing",
      "requests": [
        {
          "request_id": "patch_missing",
          "method": "PATCH",
          "path": "/orders/99",
          "raw_body": "{\"quantity\":3}",
          "content_type": "application/vnd.maknow.order-patch+json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          404
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 404,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:not-found",
              "title": "Order not found",
              "status": 404,
              "instance": "urn:maknow:request:patch_missing",
              "traceId": "trace-patch_missing"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "patch_unauthenticated": {
      "case_id": "patch_unauthenticated",
      "requests": [
        {
          "request_id": "patch_unauthenticated",
          "method": "PATCH",
          "path": "/orders/1",
          "raw_body": "{\"quantity\":3}",
          "content_type": "application/vnd.maknow.order-patch+json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": false,
            "subject": null,
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          401
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 401,
            "content_type": "application/problem+json",
            "headers": {
              "WWW-Authenticate": "Bearer"
            },
            "body": {
              "type": "urn:maknow:problem:unauthenticated",
              "title": "Authentication required",
              "status": 401,
              "instance": "urn:maknow:request:patch_unauthenticated",
              "traceId": "trace-patch_unauthenticated"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION"
            ]
          }
        ]
      }
    },
    "patch_forbidden": {
      "case_id": "patch_forbidden",
      "requests": [
        {
          "request_id": "patch_forbidden",
          "method": "PATCH",
          "path": "/orders/1",
          "raw_body": "{\"quantity\":3}",
          "content_type": "application/vnd.maknow.order-patch+json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": []
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          403
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 403,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:forbidden",
              "title": "Access denied",
              "status": 403,
              "instance": "urn:maknow:request:patch_forbidden",
              "traceId": "trace-patch_forbidden"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION"
            ]
          }
        ]
      }
    },
    "patch_invalid": {
      "case_id": "patch_invalid",
      "requests": [
        {
          "request_id": "patch_invalid",
          "method": "PATCH",
          "path": "/orders/1",
          "raw_body": "{\"quantity\":0}",
          "content_type": "application/vnd.maknow.order-patch+json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          422
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 422,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:validation",
              "title": "Order validation failed",
              "status": 422,
              "instance": "urn:maknow:request:patch_invalid",
              "traceId": "trace-patch_invalid"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION"
            ]
          }
        ]
      }
    },
    "patch_wrong_media": {
      "case_id": "patch_wrong_media",
      "requests": [
        {
          "request_id": "patch_wrong_media",
          "method": "PATCH",
          "path": "/orders/1",
          "raw_body": "{\"quantity\":3}",
          "content_type": "application/json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          415
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 415,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:unsupported-media",
              "title": "Unsupported media type",
              "status": 415,
              "instance": "urn:maknow:request:patch_wrong_media",
              "traceId": "trace-patch_wrong_media"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING"
            ]
          }
        ]
      }
    },
    "patch_binding": {
      "case_id": "patch_binding",
      "requests": [
        {
          "request_id": "patch_binding",
          "method": "PATCH",
          "path": "/orders/1",
          "raw_body": "{\"quantity\":\"3\"}",
          "content_type": "application/vnd.maknow.order-patch+json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          400
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 400,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:invalid-request",
              "title": "Invalid request",
              "status": 400,
              "instance": "urn:maknow:request:patch_binding",
              "traceId": "trace-patch_binding"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING"
            ]
          }
        ]
      }
    },
    "patch_failure": {
      "case_id": "patch_failure",
      "requests": [
        {
          "request_id": "patch_failure",
          "method": "PATCH",
          "path": "/orders/1",
          "raw_body": "{\"quantity\":3}",
          "content_type": "application/vnd.maknow.order-patch+json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "FAIL"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          500
        ],
        "writes": 0,
        "dependency_calls": 1,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 500,
            "content_type": "application/problem+json",
            "headers": {},
            "body": {
              "type": "urn:maknow:problem:unexpected",
              "title": "Unexpected failure",
              "status": 500,
              "instance": "urn:maknow:request:patch_failure",
              "traceId": "trace-patch_failure"
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          }
        ]
      }
    },
    "patch_same": {
      "case_id": "patch_same",
      "requests": [
        {
          "request_id": "patch_same",
          "method": "PATCH",
          "path": "/orders/1",
          "raw_body": "{\"quantity\":2}",
          "content_type": "application/vnd.maknow.order-patch+json",
          "accept": "application/json, application/problem+json",
          "principal": {
            "authenticated": true,
            "subject": "actor-a",
            "permissions": [
              "Orders.Read",
              "Orders.Write"
            ]
          },
          "idempotency_key": "k-01",
          "dependency": "OK"
        }
      ],
      "concurrent": false,
      "expected": {
        "statuses": [
          200
        ],
        "writes": 0,
        "dependency_calls": 0,
        "final_orders": [
          {
            "id": 1,
            "customerReference": "seed-01",
            "quantity": 2
          }
        ],
        "responses": [
          {
            "status": 200,
            "content_type": "application/json",
            "headers": {},
            "body": {
              "id": 1,
              "customerReference": "seed-01",
              "quantity": 2
            },
            "trace": [
              "EXCEPTION_HANDLER",
              "ROUTING",
              "AUTHENTICATION",
              "AUTHORIZATION",
              "BINDING",
              "VALIDATION",
              "HANDLER"
            ]
          }
        ]
      }
    }
  },
  "scope": "Synthetic exercise contract, not permission to deploy. Requests use test identities, not tokens. Each case gets fresh seed state; multi-request cases share only their case state."
}
