{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://offeringprotocol.org/schemas/problem-details.schema.json",
  "title": "ODP Problem Details",
  "type": "object",
  "required": [
    "type",
    "title",
    "status",
    "code"
  ],
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://offeringprotocol\\.org/problems/[a-z0-9][a-z0-9-]*$"
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 128
    },
    "status": {
      "type": "integer",
      "minimum": 400,
      "maximum": 599
    },
    "code": {
      "$ref": "problem-code.schema.json"
    },
    "detail": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2048
    },
    "instance": {
      "type": "string",
      "format": "uri-reference",
      "maxLength": 2048
    },
    "invalid_params": {
      "type": "array",
      "minItems": 1,
      "maxItems": 32,
      "items": {
        "$ref": "invalid-parameter.schema.json"
      }
    }
  },
  "allOf": [
    {
      "if": {
        "required": [
          "invalid_params"
        ]
      },
      "then": {
        "properties": {
          "code": {
            "const": "INVALID_REQUEST"
          }
        }
      }
    }
  ]
}
