{
  "$id": "https://oompf.run/schemas/error.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Stable JSON error envelope returned by every non-2xx OOMPF API response.",
  "examples": [
    {
      "error": {
        "code": "not_found",
        "message": "No indexed profile with id \"prof_0000\"."
      }
    },
    {
      "error": {
        "code": "validation_failed",
        "details": [
          "modelRoles must be a mapping of role to model."
        ],
        "message": "The profile is not a structurally valid OMP artifact."
      }
    }
  ],
  "properties": {
    "error": {
      "additionalProperties": false,
      "properties": {
        "code": {
          "description": "Stable machine-readable error code.",
          "enum": [
            "invalid_source",
            "source_not_found",
            "ambiguous_source",
            "source_unreachable",
            "validation_failed",
            "blocking_secrets",
            "not_found",
            "server_misconfigured",
            "internal_error"
          ],
          "type": "string"
        },
        "details": {
          "description": "Optional actionable specifics. Never contains a secret value.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "message": {
          "description": "Human-readable explanation of the failure.",
          "type": "string"
        }
      },
      "required": [
        "code",
        "message"
      ],
      "type": "object"
    }
  },
  "required": [
    "error"
  ],
  "title": "OOMPF Error Envelope",
  "type": "object"
}